Review fixes - add clCreateProgramWithILKHR in linkage and op_opaque tests

This commit is contained in:
Grzegorz Wawiorko
2020-04-03 13:39:05 +02:00
committed by Alastair Murray
parent 2a8cecb925
commit 75dfd356d7
2 changed files with 40 additions and 4 deletions

View File

@@ -33,8 +33,25 @@ static int test_linkage_compile(cl_device_id deviceID,
}
unsigned char *buffer = &buffer_vec[0];
prog = clCreateProgramWithIL(context, buffer, file_bytes, &err);
SPIRV_CHECK_ERROR(err, "Failed to create program with clCreateProgramWithIL");
if (gCoreILProgram) {
prog = clCreateProgramWithIL(context, buffer, file_bytes, &err);
SPIRV_CHECK_ERROR(err, "Failed to create program with clCreateProgramWithIL");
}
else {
cl_platform_id platform;
err = clGetDeviceInfo(deviceID, CL_DEVICE_PLATFORM, sizeof(cl_platform_id), &platform, NULL);
SPIRV_CHECK_ERROR(err, "Failed to get platform info with clGetDeviceInfo");
clCreateProgramWithILKHR_fn clCreateProgramWithILKHR = NULL;
clCreateProgramWithILKHR = (clCreateProgramWithILKHR_fn)clGetExtensionFunctionAddressForPlatform(platform, "clCreateProgramWithILKHR");
if (clCreateProgramWithILKHR == NULL)
{
log_error("ERROR: clGetExtensionFunctionAddressForPlatform failed\n");
return -1;
}
prog = clCreateProgramWithILKHR(context, buffer, file_bytes, &err);
SPIRV_CHECK_ERROR(err, "Failed to create program with clCreateProgramWithILKHR");
}
err = clCompileProgram(prog, 1, &deviceID,
NULL, // options