[CUDA] Add support for binary type query#990
[CUDA] Add support for binary type query#990fabiomestre wants to merge 3 commits intooneapi-src:adaptersfrom
Conversation
f4c6c37 to
385f706
Compare
|
@oneapi-src/unified-runtime-cuda-write Would be great if someone could have a look a this PR |
jchlanda
left a comment
There was a problem hiding this comment.
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.
@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.
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.
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.
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:
urProgramCompileshould set the binary type toUR_PROGRAM_BINARY_TYPE_COMPILED_OBJECTurProgramBuild/urProgramLinkshould set it toUR_PROGRAM_BINARY_TYPE_EXECUTABLE.urProgramCreateWithBinaryshould set the binary type toUR_PROGRAM_BINARY_TYPE_COMPILED_OBJECT