From bbecc73ab74729111f84fcfccc9325e8ed376b4e Mon Sep 17 00:00:00 2001 From: foreman Date: Tue, 14 Apr 2015 15:46:47 -0400 Subject: [PATCH] P4 to Git Change 1140692 by gandryey@gera-w8 on 2015/04/14 15:32:03 ECR #304775 - Remove OCL_STRESS_BINARY_IMAGE Affected files ... ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_program.cpp#34 edit ... //depot/stg/opencl/drivers/opencl/runtime/utils/flags.hpp#229 edit [ROCm/clr commit: d7506a33d280a6c58fb9a65b2e656f7cba28775f] --- .../opencl/api/opencl/amdocl/cl_program.cpp | 48 ------------------- 1 file changed, 48 deletions(-) diff --git a/projects/clr/opencl/api/opencl/amdocl/cl_program.cpp b/projects/clr/opencl/api/opencl/amdocl/cl_program.cpp index eabcc3fe44..39d4a3b890 100644 --- a/projects/clr/opencl/api/opencl/amdocl/cl_program.cpp +++ b/projects/clr/opencl/api/opencl/amdocl/cl_program.cpp @@ -161,54 +161,6 @@ RUNTIME_ENTRY_RET(cl_program, clCreateProgramWithSource, ( } } -#if defined(DEBUG) - if (OCL_STRESS_BINARY_IMAGE) { - size_t num_devices = devices.size(); - cl_int ret; - - cl_device_id* device_list = new cl_device_id[num_devices]; - memset(device_list, (int) (num_devices * sizeof(cl_device_id)), '\0'); - clGetProgramInfo(as_cl(program), CL_PROGRAM_DEVICES, - num_devices * sizeof(cl_device_id), device_list, NULL); - - clBuildProgram(as_cl(program), (int) num_devices, device_list, NULL, NULL, NULL); - - size_t* lengths = new size_t[num_devices]; - memset(lengths, (int) (num_devices * sizeof(size_t)), '\0'); - clGetProgramInfo(as_cl(program), CL_PROGRAM_BINARY_SIZES, - num_devices * sizeof(size_t), lengths, NULL); - - unsigned char** binaries = new unsigned char*[num_devices]; - for (size_t i = 0; i < num_devices; ++i) { - binaries[i] = new unsigned char[lengths[i]]; - memset(binaries[i], (int) lengths[i], '\0'); - } - clGetProgramInfo(as_cl(program), CL_PROGRAM_BINARIES, - num_devices * sizeof(unsigned char*), binaries, NULL); - - program->release(); - - cl_program new_prg = clCreateProgramWithBinary( - context, (int) num_devices, device_list, lengths, - (const unsigned char **) binaries, NULL, &ret); - - - for (size_t i = 0; i < num_devices; ++i) { - delete[] binaries[i]; - } - delete[] binaries; - delete[] lengths; - delete[] device_list; - - if (ret != CL_SUCCESS) { - *not_null(errcode_ret) = ret; - return NULL; - } - - program = as_amd(new_prg); - } -#endif // DEBUG - *not_null(errcode_ret) = CL_SUCCESS; return as_cl(program); }