Implement Negative Test for Platform Layer Functions (#1076)

* Implement Negative Tests for clPlatform Functions

This change introduces negative tests for clPlatform
functions as well as changes to the Harness to help with
other negative tests.

Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>

* [SQUASH] Remove magic macro from Negative Platform Tests

This change removes the negative-testing macro and all
other changes related to its usage.

Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
This commit is contained in:
Chetan Mistry
2021-02-05 16:36:16 +00:00
committed by GitHub
parent 3719a0183c
commit f6b501352d
7 changed files with 105 additions and 0 deletions

View File

@@ -68,6 +68,7 @@ const char *IGetErrorString(int clErrorCode)
case CL_INVALID_SAMPLER: return "CL_INVALID_SAMPLER";
case CL_INVALID_BINARY: return "CL_INVALID_BINARY";
case CL_INVALID_BUILD_OPTIONS: return "CL_INVALID_BUILD_OPTIONS";
case CL_INVALID_PLATFORM: return "CL_INVALID_PLATFORM";
case CL_INVALID_PROGRAM: return "CL_INVALID_PROGRAM";
case CL_INVALID_PROGRAM_EXECUTABLE:
return "CL_INVALID_PROGRAM_EXECUTABLE";

View File

@@ -1161,6 +1161,15 @@ test_status check_spirv_compilation_readiness(cl_device_id device)
return TEST_PASS;
}
cl_platform_id getPlatformFromDevice(cl_device_id deviceID)
{
cl_platform_id platform = nullptr;
cl_int err = clGetDeviceInfo(deviceID, CL_DEVICE_PLATFORM, sizeof(platform),
&platform, nullptr);
ASSERT_SUCCESS(err, "clGetDeviceInfo");
return platform;
}
void PrintArch(void)
{
vlog("sizeof( void*) = %ld\n", sizeof(void *));

View File

@@ -178,6 +178,8 @@ extern int gHasLong; // This is set to 1 if the device suppots long and ulong
// types in OpenCL C.
extern bool gCoreILProgram;
extern cl_platform_id getPlatformFromDevice(cl_device_id deviceID);
#if !defined(__APPLE__)
void memset_pattern4(void *, const void *, size_t);
#endif