-
Notifications
You must be signed in to change notification settings - Fork 179
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
[DO NOT MERGE] [CUDAX] <cuda/experimental/file>
proposal
#3360
base: main
Are you sure you want to change the base?
Conversation
__handle_ = detail::__cufile_handle_register(&__descr); | ||
} | ||
|
||
::std::FILE* __file_{}; |
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.
I am not sure if using FILE
is the right solution, maybe it would be better to implement the class as a wrapper around the native handle.
struct property | ||
{ | ||
// Prop obj 1 | ||
// Prop obj 2 | ||
// ... | ||
}; | ||
|
||
template <class Prop> | ||
auto get(const Prop& prop) | ||
{ | ||
return prop.get(); | ||
} | ||
|
||
template <class Prop> | ||
void set(const Prop& prop, ::cuda::std::type_identity_t<typename Prop::value_type> value) | ||
{ | ||
prop.set(value); | ||
} |
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 would be implemented the same way as e. g. device attributes.
#if !_CCCL_OS(LINUX) | ||
# error "<cuda/experimental/file> is only supported on Linux." | ||
#endif // _CCCL_OS(LINUX) |
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.
cuFile does not support other platforms than Linux for now.
auto __error = | ||
::cudaLaunchHostFunc(__stream, ::cuda::experimental::detail::__check_cufile_read_async_error, __nbytes_read_ptr); |
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.
The problem is that cuFileReadAsync
returns any error in the __nbytes_read_ptr
variable, so I run a host function that will throw if a cuFile error occures.
auto __error = ::cudaLaunchHostFunc( | ||
__stream, ::cuda::experimental::detail::__check_cufile_write_async_error, __nbytes_written_ptr); |
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.
The same story as for the async read.
<cuda/experimental/file>
<cuda/experimental/file>
proposal
See #3359.