-
Notifications
You must be signed in to change notification settings - Fork 803
[L0v2] add multiple submission modes in queue gtests #20969
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
base: sycl
Are you sure you want to change the base?
[L0v2] add multiple submission modes in queue gtests #20969
Conversation
e193914 to
8a4d851
Compare
add a macro for a default submission mode when the test does not use any queue
I would prefer the latter if its related to functionality we want to eventually support.
Let's just remove it. |
pbalcer
left a comment
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.
broadly lgtm
| return uur::GetPlatformAndDeviceName(info.param.device); \ | ||
| testing::Combine( \ | ||
| ::testing::ValuesIn(uur::DevicesEnvironment::instance->devices), \ | ||
| ::testing::Values(0)), \ |
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.
| ::testing::Values(0)), \ | |
| ::testing::Values(0)), // default queue \ |
| template <typename T> | ||
| inline std::string printImageCopyTestStringMultiQueue( | ||
| const testing::TestParamInfo<typename T::ParamType> &info) { | ||
| // ParamType will be std::tuple<ur_device_handle_t, ur_mem_type_t> | ||
| const auto device_handle = std::get<0>(info.param).device; | ||
| const auto platform_device_name = | ||
| uur::GetPlatformAndDeviceName(device_handle); | ||
|
|
||
| auto paramTuple = std::get<1>(info.param); | ||
| const auto image_type = std::get<0>(paramTuple); //std::get<1>(info.param); | ||
| const auto queue_mode = std::get<1>(paramTuple); | ||
| auto test_name = (image_type == UR_MEM_TYPE_IMAGE1D) ? "1D" | ||
| : (image_type == UR_MEM_TYPE_IMAGE2D) ? "2D" | ||
| : "3D"; | ||
| std::stringstream ss; | ||
| ss << platform_device_name << "__" << test_name << "__" << queue_mode; | ||
|
|
||
| return ss.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.
You duplicated all the print... functions, adding a queue variant. Would it be possible to use the original print function, and then just append the queue mode afterwards? Something like:
inline std::string printImageCopyTestStringMultiQueue(
const testing::TestParamInfo<typename T::ParamType> &info) {
auto str = printImageCopyTestString(info); // this info param would need to be converted somehow
const auto queue_mode = std::get<1>(paramTuple);
std::stringstream ss;
ss << str<< "__" << queue_mode;
return ss.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.
I think it's possible to rework all of them, I've been just not sure whether we would need them in the future.
@pbalcer At this moment EnqueueTimestamp and USM alloc/free are omitted (at least as I remember). Do they qualify for |
Yes, we will definitely want to implement these features on the batch queue. |
A few solutions and a few questions.
Modifications allow for running tests with different queue submission modes, either specified by the user or provided by default. This is made possible through the introduced macros:
UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(FIXTURE): instantiates the providedFIXTUREwith the submission modes:UR_QUEUE_FLAG_SUBMISSION_BATCHEDandUR_QUEUE_FLAG_SUBMISSION_IMMEDIATEUUR_MULTI_QUEUE_TYPE_TEST_SUITE_WITH_PARAM(FIXTURE, VALUES, PRINTER): similarly instantiates theFIXTUREwith either batched or immediate submission modes, but additionally accepts parametersUUR_DEVICE_TEST_SUITE_WITH_QUEUE_TYPES(FIXTURE, MODES): instantiates the providedFIXTUREwith queue submission modes provided by the user (work in progress)UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE(FIXTURE): provides only one default submission mode (specified as 0); the exact mode is chosen by the deviceTests that do not use any queue (like most of the urProgramTests, except for urProgramSetSpecializationConstantsTest) are instantiated using
UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE. There might be more tests that do not need a queue, since the heuristic for determining whether the given test needs a queue consisted of checking whether the queue defined in the test class is mentioned in the test file (not checked per derived test class).This PR introduces equivalents for
urQueueTestfor unparametrized tests andurQueueTestWithParam, which areurMultiQueueTypeTestandurMultiQueueTypeTestWithParam, respectively. Parametrized tests use a new parameter type:MultiQueueParam (std::tuple<T, ur_queue_flag_t>). Similarly, the previously "unparametrized" tests, which were eventually parametrized with theDeviceTuple, now usestd::tuple<DeviceTuple, ur_queue_flag_t>as their parameter type.The PR is partitioned into several commits to enable comparison between versions.
Questions:
SKIP_IF_BATCHEDmacro instead?urCommandBufferCommandExpTestseems to be referenced nowhere, is it needed?