Skip to content
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

vulkan: accept device selection #2113

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions test_conformance/vulkan/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,18 @@ static void printUsage(const char *execName)
log_info("\t--non_dedicated - Choose dedicated Vs. non_dedicated \n");
}

bool isDeviceSelection(const char *arg)
{

return strcmp(arg, "gpu") == 0 || strcmp(arg, "CL_DEVICE_TYPE_GPU") == 0
|| strcmp(arg, "cpu") == 0 || strcmp(arg, "CL_DEVICE_TYPE_CPU") == 0
|| strcmp(arg, "accelerator") == 0
|| strcmp(arg, "CL_DEVICE_TYPE_ACCELERATOR") == 0
|| strcmp(arg, "custom") == 0
|| strcmp(arg, "CL_DEVICE_TYPE_CUSTOM") == 0
|| strcmp(arg, "CL_DEVICE_TYPE_DEFAULT") == 0;
}

size_t parseParams(int argc, const char *argv[], const char **argList)
{
size_t argCount = 1;
Expand Down Expand Up @@ -236,6 +248,16 @@ size_t parseParams(int argc, const char *argv[], const char **argList)
break;
}
}
else if (isDeviceSelection(argv[i]))
{
if (strcmp(argv[i], "gpu") != 0
&& strcmp(argv[i], "CL_DEVICE_TYPE_GPU") != 0
&& strcmp(argv[i], "CL_DEVICE_TYPE_DEFAULT") != 0)
{
log_info("Vulkan tests can only run on a GPU device.\n");
return 0;
}
}
else
{
argList[argCount] = argv[i];
Expand Down
Loading