Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ttg device support master coro - util/device.h #5

Open
wants to merge 93 commits into
base: ttg-device-support-master-coro
Choose a base branch
from

Conversation

therault
Copy link

@therault therault commented Mar 8, 2023

Add util/device.h and a ttg::device namespace to expose the C-like allocator, and a few util functions.

devreal and others added 30 commits October 14, 2022 13:46
Signed-off-by: Joseph Schuchart <[email protected]>
# Conflicts:
#	examples/CMakeLists.txt
(cherry picked from commit 8147ac0)
The views on the device will be handled by the backend, not in ttg::make_view

Signed-off-by: Joseph Schuchart <[email protected]>
[ttg|std]::span is not a good fit because it carries a size template
argument that we don't care about but makes handling more difficult.
Plus, we need to encode the scope for each span.

Three scopes are available:
1) SyncIn: copy host data to device before invoking the kernel callable.
2) SyncOut: copy the device data back to the host before invoking the output callable.
3) Allocate: allocate but do not synchronize in or out.

Both SyncIn and SyncOut will allocate sufficient memory on the device.

Signed-off-by: Joseph Schuchart <[email protected]>
- TTG_HAVE_CUDA enables CUDA support: synchronizing the stream between
  the kernel call and the output call.
- TTG_USE_CUDA_PREFETCH enables support for prefetching based on the view scope.

Signed-off-by: Joseph Schuchart <[email protected]>
devreal and others added 18 commits January 26, 2023 12:56
Signed-off-by: Joseph Schuchart <[email protected]>
… the key in the profiling info under the parsec driver
}
detail::ttg_devid[i] = -1;
}
detail::parsec_devid = new int[detail::nb_ttg_devices];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mhh, this means we always have to call nb() to get a valid pointer, before we can call allocate().

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'm aware of that, that's why allocate() and free() (and other functions that rely on the conversion) always do check if( nb() >= ... ) as the first instruction before using detail::parsec_devid ... But maybe it's too circumvoluted...

There are alternatives... Let me know if you want to discuss this.

@@ -0,0 +1,13 @@
#ifndef TTG_UTILS_DEVICE_H
#define TTG_UTILS_DEVICE_H
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not util functionality, but provided to the user. Should be one level up. I think we should put all device-related functions and objects into the ttg::device:: namespace.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine with me, I'll promote.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See e7fc769

@therault therault force-pushed the ttg-device-support-master-coro branch from e7fc769 to 2a195f2 Compare March 15, 2023 17:21
Refactor allocator API to be more object-oriented
@therault therault force-pushed the ttg-device-support-master-coro branch from 2a195f2 to 7a08f07 Compare March 15, 2023 17:23
@devreal devreal force-pushed the ttg-device-support-master-coro branch from db6be87 to 91e13e8 Compare June 9, 2023 17:41
@devreal devreal force-pushed the ttg-device-support-master-coro branch from e0735a7 to 8362742 Compare July 6, 2023 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants