mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Fix vulkan subtest for diffCtx and platform/device info (#2046)
Fixes: 1. Multi import diff ctx subtest which acquires/releases external memory via queue not associated with the context in which memory was imported. 2. Platform/Device info subtests to handle different platforms and availability of the query.
This commit is contained in:
@@ -1294,6 +1294,43 @@ cl_platform_id getPlatformFromDevice(cl_device_id deviceID)
|
||||
return platform;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper to return a string containing platform information
|
||||
* for the specified platform info parameter.
|
||||
*/
|
||||
std::string get_platform_info_string(cl_platform_id platform,
|
||||
cl_platform_info param_name)
|
||||
{
|
||||
size_t size = 0;
|
||||
int err;
|
||||
|
||||
if ((err = clGetPlatformInfo(platform, param_name, 0, NULL, &size))
|
||||
!= CL_SUCCESS
|
||||
|| size == 0)
|
||||
{
|
||||
throw std::runtime_error("clGetPlatformInfo failed\n");
|
||||
}
|
||||
|
||||
std::vector<char> info(size);
|
||||
|
||||
if ((err = clGetPlatformInfo(platform, param_name, size, info.data(), NULL))
|
||||
!= CL_SUCCESS)
|
||||
{
|
||||
throw std::runtime_error("clGetPlatformInfo failed\n");
|
||||
}
|
||||
|
||||
/* The returned string does not include the null terminator. */
|
||||
return std::string(info.data(), size - 1);
|
||||
}
|
||||
|
||||
bool is_platform_extension_available(cl_platform_id platform,
|
||||
const char *extensionName)
|
||||
{
|
||||
std::string extString =
|
||||
get_platform_info_string(platform, CL_PLATFORM_EXTENSIONS);
|
||||
return extString.find(extensionName) != std::string::npos;
|
||||
}
|
||||
|
||||
void PrintArch(void)
|
||||
{
|
||||
vlog("sizeof( void*) = %zu\n", sizeof(void *));
|
||||
|
||||
@@ -185,6 +185,10 @@ extern int gHasLong; // This is set to 1 if the device suppots long and ulong
|
||||
extern bool gCoreILProgram;
|
||||
|
||||
extern cl_platform_id getPlatformFromDevice(cl_device_id deviceID);
|
||||
extern std::string get_platform_info_string(cl_platform_id platform,
|
||||
cl_platform_info param_name);
|
||||
extern bool is_platform_extension_available(cl_platform_id platform,
|
||||
const char *extensionName);
|
||||
|
||||
#if !defined(__APPLE__)
|
||||
void memset_pattern4(void *, const void *, size_t);
|
||||
|
||||
Reference in New Issue
Block a user