-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Support v3 cuda array interface. #6776
Support v3 cuda array interface. #6776
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6776 +/- ##
=======================================
Coverage 81.78% 81.78%
=======================================
Files 13 13
Lines 3848 3848
=======================================
Hits 3147 3147
Misses 701 701 Continue to review full report at Codecov.
|
cudaStreamCreate(&stream); | ||
|
||
auto j_arr =Json::Load(StringView{arr_str}); | ||
j_arr["stream"] = Integer(reinterpret_cast<int64_t>(stream)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a safe cast?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you start reinterpreting bits,it's hard to argue what's safe ..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the stream a memory address, or is it something else, like a struct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's an opaque pointer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Then casting it to an integer should be safe.
dh::caching_device_vector<uint64_t> out(1, 0); | ||
uint64_t dur = 1e9; | ||
dh::LaunchKernel{1, 1, 0, stream}(SleepForTest, out.data().get(), dur); | ||
ArrayInterface arr(arr_str); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice test to test whether stream
has been properly synchronized.
Close #6753 .