-
Notifications
You must be signed in to change notification settings - Fork 117
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
[CUDA] Add support for binary type query #990
[CUDA] Add support for binary type query #990
Conversation
f4c6c37
to
385f706
Compare
@oneapi-src/unified-runtime-cuda-write Would be great if someone could have a look a this PR |
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.
LGTM
Does it need any new test, or is it already covered?
/// Note: No calls to CUDA driver API in this function, only store binaries | ||
/// for later. | ||
/// | ||
/// Note: Only supports one device |
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.
@hdelan is that something we need to think about with multi device context (also the comment at the bottom of the diff)?
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 should be OK. The entry point has a Device param, so multi dev ctx just changes constructor of program to take the device as well
source/adapters/cuda/program.cpp
Outdated
UR_RESULT_ERROR_INVALID_CONTEXT); | ||
UR_ASSERT(size, UR_RESULT_ERROR_INVALID_SIZE); | ||
|
||
ur_result_t Result = UR_RESULT_SUCCESS; |
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.
Result
doesn't seem to be needed, maybe wrap the calls directly in UR_ASSERT
and return UR_SUCCESS
at the end to simplify?
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 updated it to use UR_CHECK_ERROR 👍
385f706
to
2282bf2
Compare
There is already a test in the UR CTS that checks this flag |
CUDA does not make a distinction between binaryTypes (it treats PTX and binaries using the same entrypoints).
However, for UR, by definition:
urProgramCompile
should set the binary type toUR_PROGRAM_BINARY_TYPE_COMPILED_OBJECT
urProgramBuild
/urProgramLink
should set it toUR_PROGRAM_BINARY_TYPE_EXECUTABLE
.urProgramCreateWithBinary
should set the binary type toUR_PROGRAM_BINARY_TYPE_COMPILED_OBJECT