minor update
This commit is contained in:
@@ -36,9 +36,9 @@ run-simx:
|
|||||||
$(MAKE) -C lbm run-simx
|
$(MAKE) -C lbm run-simx
|
||||||
$(MAKE) -C oclprintf run-simx
|
$(MAKE) -C oclprintf run-simx
|
||||||
$(MAKE) -C blackscholes run-simx
|
$(MAKE) -C blackscholes run-simx
|
||||||
$(MAKE) -C matmul run-simx
|
|
||||||
$(MAKE) -C transpose run-simx
|
$(MAKE) -C transpose run-simx
|
||||||
$(MAKE) -C convolution run-simx
|
$(MAKE) -C convolution run-simx
|
||||||
|
# $(MAKE) -C matmul run-simx
|
||||||
# $(MAKE) -C vectorhypot run-simx
|
# $(MAKE) -C vectorhypot run-simx
|
||||||
# $(MAKE) -C mri-q run-simx
|
# $(MAKE) -C mri-q run-simx
|
||||||
|
|
||||||
@@ -59,8 +59,8 @@ run-rtlsim:
|
|||||||
$(MAKE) -C lbm run-rtlsim
|
$(MAKE) -C lbm run-rtlsim
|
||||||
$(MAKE) -C oclprintf run-rtlsim
|
$(MAKE) -C oclprintf run-rtlsim
|
||||||
$(MAKE) -C blackscholes run-rtlsim
|
$(MAKE) -C blackscholes run-rtlsim
|
||||||
$(MAKE) -C matmul run-rtlsim
|
|
||||||
$(MAKE) -C convolution run-rtlsim
|
$(MAKE) -C convolution run-rtlsim
|
||||||
|
# $(MAKE) -C matmul run-rtlsim
|
||||||
# $(MAKE) -C vectorhypot run-rtlsim
|
# $(MAKE) -C vectorhypot run-rtlsim
|
||||||
# $(MAKE) -C mri-q run-rtlsim
|
# $(MAKE) -C mri-q run-rtlsim
|
||||||
|
|
||||||
@@ -81,8 +81,8 @@ run-opae:
|
|||||||
$(MAKE) -C lbm run-opae
|
$(MAKE) -C lbm run-opae
|
||||||
$(MAKE) -C oclprintf run-opae
|
$(MAKE) -C oclprintf run-opae
|
||||||
$(MAKE) -C blackscholes run-opae
|
$(MAKE) -C blackscholes run-opae
|
||||||
$(MAKE) -C matmul run-opae
|
|
||||||
$(MAKE) -C convolution run-opae
|
$(MAKE) -C convolution run-opae
|
||||||
|
# $(MAKE) -C matmul run-opae
|
||||||
# $(MAKE) -C vectorhypot run-opae
|
# $(MAKE) -C vectorhypot run-opae
|
||||||
# $(MAKE) -C mri-q run-opae
|
# $(MAKE) -C mri-q run-opae
|
||||||
|
|
||||||
|
|||||||
@@ -41,13 +41,12 @@ CXXFLAGS += -std=c++11 -Wall -Wextra -Wfatal-errors
|
|||||||
CXXFLAGS += -Wno-deprecated-declarations -Wno-unused-parameter -Wno-narrowing
|
CXXFLAGS += -Wno-deprecated-declarations -Wno-unused-parameter -Wno-narrowing
|
||||||
CXXFLAGS += -pthread
|
CXXFLAGS += -pthread
|
||||||
CXXFLAGS += -I$(POCL_RT_PATH)/include
|
CXXFLAGS += -I$(POCL_RT_PATH)/include
|
||||||
LDFLAGS += -L$(POCL_RT_PATH)/lib -L$(VORTEX_RT_PATH)/stub -lvortex
|
|
||||||
|
|
||||||
ifdef HOSTGPU
|
ifdef HOSTGPU
|
||||||
CXXFLAGS += -DHOSTGPU
|
CXXFLAGS += -DHOSTGPU
|
||||||
LDFLAGS += -lOpenCL
|
LDFLAGS += -lOpenCL
|
||||||
else
|
else
|
||||||
LDFLAGS += $(POCL_RT_PATH)/lib/libOpenCL.so
|
LDFLAGS += -L$(VORTEX_RT_PATH)/stub -lvortex $(POCL_RT_PATH)/lib/libOpenCL.so
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Debugigng
|
# Debugigng
|
||||||
|
|||||||
@@ -106,11 +106,6 @@ int main (int argc, char **argv) {
|
|||||||
|
|
||||||
cl_platform_id platform_id;
|
cl_platform_id platform_id;
|
||||||
size_t kernel_size;
|
size_t kernel_size;
|
||||||
cl_int binary_status;
|
|
||||||
|
|
||||||
// read kernel binary from file
|
|
||||||
if (0 != read_kernel_file("kernel.pocl", &kernel_bin, &kernel_size))
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
// Getting platform and device information
|
// Getting platform and device information
|
||||||
CL_CHECK(clGetPlatformIDs(1, &platform_id, NULL));
|
CL_CHECK(clGetPlatformIDs(1, &platform_id, NULL));
|
||||||
@@ -124,12 +119,17 @@ int main (int argc, char **argv) {
|
|||||||
a_memobj = CL_CHECK2(clCreateBuffer(context, CL_MEM_READ_ONLY, nbytes, NULL, &_err));
|
a_memobj = CL_CHECK2(clCreateBuffer(context, CL_MEM_READ_ONLY, nbytes, NULL, &_err));
|
||||||
|
|
||||||
printf("Create program from kernel source\n");
|
printf("Create program from kernel source\n");
|
||||||
program = CL_CHECK2(clCreateProgramWithBinary(
|
#ifdef HOSTGPU
|
||||||
context, 1, &device_id, &kernel_size, (const uint8_t**)&kernel_bin, &binary_status, &_err));
|
if (0 != read_kernel_file("kernel.cl", &kernel_bin, &kernel_size))
|
||||||
if (program == NULL) {
|
|
||||||
cleanup();
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
program = CL_CHECK2(clCreateProgramWithSource(
|
||||||
|
context, 1, (const char**)&kernel_bin, &kernel_size, &_err));
|
||||||
|
#else
|
||||||
|
if (0 != read_kernel_file("kernel.pocl", &kernel_bin, &kernel_size))
|
||||||
|
return -1;
|
||||||
|
program = CL_CHECK2(clCreateProgramWithBinary(
|
||||||
|
context, 1, &device_id, &kernel_size, (const uint8_t**)&kernel_bin, NULL, &_err));
|
||||||
|
#endif
|
||||||
|
|
||||||
// Build program
|
// Build program
|
||||||
CL_CHECK(clBuildProgram(program, 1, &device_id, NULL, NULL, NULL));
|
CL_CHECK(clBuildProgram(program, 1, &device_id, NULL, NULL, NULL));
|
||||||
|
|||||||
@@ -115,11 +115,6 @@ int main (int argc, char **argv) {
|
|||||||
|
|
||||||
cl_platform_id platform_id;
|
cl_platform_id platform_id;
|
||||||
size_t kernel_size;
|
size_t kernel_size;
|
||||||
cl_int binary_status;
|
|
||||||
|
|
||||||
// read kernel binary from file
|
|
||||||
if (0 != read_kernel_file("kernel.pocl", &kernel_bin, &kernel_size))
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
// Getting platform and device information
|
// Getting platform and device information
|
||||||
CL_CHECK(clGetPlatformIDs(1, &platform_id, NULL));
|
CL_CHECK(clGetPlatformIDs(1, &platform_id, NULL));
|
||||||
@@ -134,12 +129,17 @@ int main (int argc, char **argv) {
|
|||||||
c_memobj = CL_CHECK2(clCreateBuffer(context, CL_MEM_WRITE_ONLY, nbytes, NULL, &_err));
|
c_memobj = CL_CHECK2(clCreateBuffer(context, CL_MEM_WRITE_ONLY, nbytes, NULL, &_err));
|
||||||
|
|
||||||
printf("Create program from kernel source\n");
|
printf("Create program from kernel source\n");
|
||||||
program = CL_CHECK2(clCreateProgramWithBinary(
|
#ifdef HOSTGPU
|
||||||
context, 1, &device_id, &kernel_size, (const uint8_t**)&kernel_bin, &binary_status, &_err));
|
if (0 != read_kernel_file("kernel.cl", &kernel_bin, &kernel_size))
|
||||||
if (program == NULL) {
|
|
||||||
cleanup();
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
program = CL_CHECK2(clCreateProgramWithSource(
|
||||||
|
context, 1, (const char**)&kernel_bin, &kernel_size, &_err));
|
||||||
|
#else
|
||||||
|
if (0 != read_kernel_file("kernel.pocl", &kernel_bin, &kernel_size))
|
||||||
|
return -1;
|
||||||
|
program = CL_CHECK2(clCreateProgramWithBinary(
|
||||||
|
context, 1, &device_id, &kernel_size, (const uint8_t**)&kernel_bin, NULL, &_err));
|
||||||
|
#endif
|
||||||
|
|
||||||
// Build program
|
// Build program
|
||||||
CL_CHECK(clBuildProgram(program, 1, &device_id, NULL, NULL, NULL));
|
CL_CHECK(clBuildProgram(program, 1, &device_id, NULL, NULL, NULL));
|
||||||
@@ -159,12 +159,12 @@ int main (int argc, char **argv) {
|
|||||||
for (int i = 0; i < size; ++i) {
|
for (int i = 0; i < size; ++i) {
|
||||||
if (float_enable) {
|
if (float_enable) {
|
||||||
float value = sinf(i)*sinf(i);
|
float value = sinf(i)*sinf(i);
|
||||||
h_a[i] = *(int*)&value;
|
((float*)h_a)[i] = value;
|
||||||
printf("*** [%d]: h_a=%f\n", i, value);
|
printf("*** [%d]: %f\n", i, value);
|
||||||
} else {
|
} else {
|
||||||
int value = size*sinf(i);
|
int value = size*sinf(i);
|
||||||
h_a[i] = value;
|
h_a[i] = value;
|
||||||
printf("*** [%d]: h_a=%d\n", i, value);
|
printf("*** [%d]: %d\n", i, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,38 +188,44 @@ int main (int argc, char **argv) {
|
|||||||
CL_CHECK(clEnqueueReadBuffer(commandQueue, c_memobj, CL_TRUE, 0, nbytes, h_c, 0, NULL, NULL));
|
CL_CHECK(clEnqueueReadBuffer(commandQueue, c_memobj, CL_TRUE, 0, nbytes, h_c, 0, NULL, NULL));
|
||||||
|
|
||||||
printf("Verify result\n");
|
printf("Verify result\n");
|
||||||
for (int i = 0; i < size; ++i) {
|
for (int i = 0; i < size; ++i) {
|
||||||
int value = h_c[i];
|
|
||||||
if (float_enable) {
|
if (float_enable) {
|
||||||
printf("*** [%d]: h_a=%f\n", i, *(float*)&value);
|
float value = ((float*)h_c)[i];
|
||||||
|
printf("*** [%d]: %f\n", i, value);
|
||||||
} else {
|
} else {
|
||||||
printf("*** [%d]: h_a=%d\n", i, value);
|
int value = h_c[i];
|
||||||
|
printf("*** [%d]: %d\n", i, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int errors = 0;
|
int errors = 0;
|
||||||
for (int i = 0; i < size; ++i) {
|
for (int i = 0; i < size; ++i) {
|
||||||
int ref = h_a[i];
|
|
||||||
float ref_f = *(float*)&ref;
|
|
||||||
int pos = 0;
|
int pos = 0;
|
||||||
for (int j = 0; j < size; ++j) {
|
if (float_enable) {
|
||||||
int cur = h_a[j];
|
float ref = ((float*)h_a)[i];
|
||||||
if (float_enable) {
|
for (int j = 0; j < size; ++j) {
|
||||||
float cur_f = *(float*)&cur;
|
float cur = ((float*)h_a)[j];
|
||||||
pos += (cur_f < ref_f) || (cur_f == ref_f && j < i);
|
pos += (cur < ref) || (cur == ref && j < i);
|
||||||
} else {
|
}
|
||||||
|
float value = ((float*)h_c)[pos];
|
||||||
|
if (value != ref) {
|
||||||
|
if (errors < 100) {
|
||||||
|
printf("*** error: [%d] expected=%f, actual=%f\n", pos, ref, value);
|
||||||
|
}
|
||||||
|
++errors;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
int ref = h_a[i];
|
||||||
|
for (int j = 0; j < size; ++j) {
|
||||||
|
int cur = h_a[j];
|
||||||
pos += (cur < ref) || (cur == ref && j < i);
|
pos += (cur < ref) || (cur == ref && j < i);
|
||||||
}
|
}
|
||||||
}
|
int value = h_c[pos];
|
||||||
int value = h_c[pos];
|
if (value != ref) {
|
||||||
if (value != ref) {
|
if (errors < 100) {
|
||||||
if (errors < 100) {
|
|
||||||
if (float_enable) {
|
|
||||||
printf("*** error: [%d] expected=%f, actual=%f\n", pos, ref_f, *(float*)&value);
|
|
||||||
} else {
|
|
||||||
printf("*** error: [%d] expected=%d, actual=%d\n", pos, ref, value);
|
printf("*** error: [%d] expected=%d, actual=%d\n", pos, ref, value);
|
||||||
}
|
}
|
||||||
|
++errors;
|
||||||
}
|
}
|
||||||
++errors;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (0 == errors) {
|
if (0 == errors) {
|
||||||
|
|||||||
@@ -151,16 +151,12 @@ int main(int argc, char **argv) {
|
|||||||
|
|
||||||
cl_platform_id platform_id;
|
cl_platform_id platform_id;
|
||||||
cl_device_id device_id;
|
cl_device_id device_id;
|
||||||
|
cl_program program;
|
||||||
cl_mem input_buffer;
|
cl_mem input_buffer;
|
||||||
cl_mem output_buffer;
|
cl_mem output_buffer;
|
||||||
size_t kernel_size;
|
size_t kernel_size;
|
||||||
cl_context context;
|
cl_context context;
|
||||||
cl_command_queue queue;
|
cl_command_queue queue;
|
||||||
cl_int binary_status = 0;
|
|
||||||
|
|
||||||
// read kernel binary from file
|
|
||||||
if (0 != read_kernel_file("kernel.pocl", &kernel_bin, &kernel_size))
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
// Getting platform and device information
|
// Getting platform and device information
|
||||||
CL_CHECK(clGetPlatformIDs(1, &platform_id, NULL));
|
CL_CHECK(clGetPlatformIDs(1, &platform_id, NULL));
|
||||||
@@ -172,19 +168,18 @@ int main(int argc, char **argv) {
|
|||||||
cl_kernel kernel = 0;
|
cl_kernel kernel = 0;
|
||||||
cl_mem memObjects[2] = {0, 0};
|
cl_mem memObjects[2] = {0, 0};
|
||||||
|
|
||||||
// Create OpenCL program - first attempt to load cached binary.
|
printf("Create program from kernel source\n");
|
||||||
// If that is not available, then create the program from source
|
#ifdef HOSTGPU
|
||||||
// and store the binary for future use.
|
if (0 != read_kernel_file("kernel.cl", &kernel_bin, &kernel_size))
|
||||||
printf("create program from binary...\n");
|
return -1;
|
||||||
cl_program program = CL_CHECK_ERR(clCreateProgramWithBinary(
|
program = CL_CHECK_ERR(clCreateProgramWithSource(
|
||||||
context, 1, &device_id, &kernel_size, (const uint8_t**)&kernel_bin, &binary_status, &_err));
|
context, 1, (const char**)&kernel_bin, &kernel_size, &_err));
|
||||||
if (program == NULL) {
|
#else
|
||||||
std::cerr << "Failed to write program binary" << std::endl;
|
if (0 != read_kernel_file("kernel.pocl", &kernel_bin, &kernel_size))
|
||||||
Cleanup(device_id, context, queue, program, kernel, memObjects);
|
return -1;
|
||||||
return 1;
|
program = CL_CHECK_ERR(clCreateProgramWithBinary(
|
||||||
} else {
|
context, 1, &device_id, &kernel_size, (const uint8_t**)&kernel_bin, NULL, &_err));
|
||||||
printf("Read program from binary.\n");
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
// Build program
|
// Build program
|
||||||
CL_CHECK(clBuildProgram(program, 1, &device_id, NULL, NULL, NULL));
|
CL_CHECK(clBuildProgram(program, 1, &device_id, NULL, NULL, NULL));
|
||||||
|
|||||||
@@ -149,14 +149,10 @@ int main(int argc, char **argv) {
|
|||||||
|
|
||||||
cl_platform_id platform_id;
|
cl_platform_id platform_id;
|
||||||
cl_device_id device_id;
|
cl_device_id device_id;
|
||||||
|
cl_program program;
|
||||||
size_t kernel_size;
|
size_t kernel_size;
|
||||||
cl_int binary_status = 0;
|
|
||||||
uint8_t *kernel_bin = NULL;
|
uint8_t *kernel_bin = NULL;
|
||||||
|
|
||||||
// read kernel binary from file
|
|
||||||
if (0 != read_kernel_file("kernel.pocl", &kernel_bin, &kernel_size))
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
// Getting platform and device information
|
// Getting platform and device information
|
||||||
CL_CHECK(clGetPlatformIDs(1, &platform_id, NULL));
|
CL_CHECK(clGetPlatformIDs(1, &platform_id, NULL));
|
||||||
CL_CHECK(clGetDeviceIDs(platform_id, CL_DEVICE_TYPE_DEFAULT, 1, &device_id, NULL));
|
CL_CHECK(clGetDeviceIDs(platform_id, CL_DEVICE_TYPE_DEFAULT, 1, &device_id, NULL));
|
||||||
@@ -170,19 +166,18 @@ int main(int argc, char **argv) {
|
|||||||
cl_kernel kernel = 0;
|
cl_kernel kernel = 0;
|
||||||
cl_mem memObjects[2] = {0, 0};
|
cl_mem memObjects[2] = {0, 0};
|
||||||
|
|
||||||
// Create OpenCL program - first attempt to load cached binary.
|
printf("Create program from kernel source\n");
|
||||||
// If that is not available, then create the program from source
|
#ifdef HOSTGPU
|
||||||
// and store the binary for future use.
|
if (0 != read_kernel_file("kernel.cl", &kernel_bin, &kernel_size))
|
||||||
printf("create program from binary...\n");
|
return -1;
|
||||||
cl_program program = CL_CHECK_ERR(clCreateProgramWithBinary(
|
program = CL_CHECK_ERR(clCreateProgramWithSource(
|
||||||
context, 1, &device_id, &kernel_size, (const uint8_t**)&kernel_bin, &binary_status, &_err));
|
context, 1, (const char**)&kernel_bin, &kernel_size, &_err));
|
||||||
if (program == NULL) {
|
#else
|
||||||
std::cerr << "Failed to write program binary" << std::endl;
|
if (0 != read_kernel_file("kernel.pocl", &kernel_bin, &kernel_size))
|
||||||
Cleanup(kernel_bin, device_id, context, queue, program, kernel, memObjects);
|
return -1;
|
||||||
return 1;
|
program = CL_CHECK_ERR(clCreateProgramWithBinary(
|
||||||
} else {
|
context, 1, &device_id, &kernel_size, (const uint8_t**)&kernel_bin, NULL, &_err));
|
||||||
printf("Read program from binary.");
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
// Build program
|
// Build program
|
||||||
CL_CHECK(clBuildProgram(program, 1, &device_id, NULL, NULL, NULL));
|
CL_CHECK(clBuildProgram(program, 1, &device_id, NULL, NULL, NULL));
|
||||||
|
|||||||
@@ -185,13 +185,8 @@ int main (int argc, char **argv) {
|
|||||||
|
|
||||||
cl_platform_id platform_id;
|
cl_platform_id platform_id;
|
||||||
size_t kernel_size;
|
size_t kernel_size;
|
||||||
cl_int binary_status;
|
|
||||||
|
|
||||||
srand(50);
|
srand(50);
|
||||||
|
|
||||||
// read kernel binary from file
|
|
||||||
if (0 != read_kernel_file("kernel.pocl", &kernel_bin, &kernel_size))
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
// Getting platform and device information
|
// Getting platform and device information
|
||||||
CL_CHECK(clGetPlatformIDs(1, &platform_id, NULL));
|
CL_CHECK(clGetPlatformIDs(1, &platform_id, NULL));
|
||||||
@@ -207,12 +202,17 @@ int main (int argc, char **argv) {
|
|||||||
c_memobj = CL_CHECK2(clCreateBuffer(context, CL_MEM_WRITE_ONLY, nbytes, NULL, &_err));
|
c_memobj = CL_CHECK2(clCreateBuffer(context, CL_MEM_WRITE_ONLY, nbytes, NULL, &_err));
|
||||||
|
|
||||||
printf("Create program from kernel source\n");
|
printf("Create program from kernel source\n");
|
||||||
program = CL_CHECK2(clCreateProgramWithBinary(
|
#ifdef HOSTGPU
|
||||||
context, 1, &device_id, &kernel_size, (const uint8_t**)&kernel_bin, &binary_status, &_err));
|
if (0 != read_kernel_file("kernel.cl", &kernel_bin, &kernel_size))
|
||||||
if (program == NULL) {
|
|
||||||
cleanup();
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
program = CL_CHECK2(clCreateProgramWithSource(
|
||||||
|
context, 1, (const char**)&kernel_bin, &kernel_size, &_err));
|
||||||
|
#else
|
||||||
|
if (0 != read_kernel_file("kernel.pocl", &kernel_bin, &kernel_size))
|
||||||
|
return -1;
|
||||||
|
program = CL_CHECK2(clCreateProgramWithBinary(
|
||||||
|
context, 1, &device_id, &kernel_size, (const uint8_t**)&kernel_bin, NULL, &_err));
|
||||||
|
#endif
|
||||||
|
|
||||||
// Build program
|
// Build program
|
||||||
CL_CHECK(clBuildProgram(program, 1, &device_id, NULL, NULL, NULL));
|
CL_CHECK(clBuildProgram(program, 1, &device_id, NULL, NULL, NULL));
|
||||||
|
|||||||
@@ -122,11 +122,6 @@ int main (int argc, char **argv) {
|
|||||||
|
|
||||||
cl_platform_id platform_id;
|
cl_platform_id platform_id;
|
||||||
size_t kernel_size;
|
size_t kernel_size;
|
||||||
cl_int binary_status;
|
|
||||||
|
|
||||||
// read kernel binary from file
|
|
||||||
if (0 != read_kernel_file("kernel.pocl", &kernel_bin, &kernel_size))
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
// Getting platform and device information
|
// Getting platform and device information
|
||||||
CL_CHECK(clGetPlatformIDs(1, &platform_id, NULL));
|
CL_CHECK(clGetPlatformIDs(1, &platform_id, NULL));
|
||||||
@@ -142,13 +137,17 @@ int main (int argc, char **argv) {
|
|||||||
c_memobj = CL_CHECK2(clCreateBuffer(context, CL_MEM_WRITE_ONLY, nbytes, NULL, &_err));
|
c_memobj = CL_CHECK2(clCreateBuffer(context, CL_MEM_WRITE_ONLY, nbytes, NULL, &_err));
|
||||||
|
|
||||||
printf("Create program from kernel source\n");
|
printf("Create program from kernel source\n");
|
||||||
cl_int _err;
|
#ifdef HOSTGPU
|
||||||
program = clCreateProgramWithBinary(
|
if (0 != read_kernel_file("kernel.cl", &kernel_bin, &kernel_size))
|
||||||
context, 1, &device_id, &kernel_size, (const uint8_t**)&kernel_bin, &binary_status, &_err);
|
|
||||||
if (program == NULL) {
|
|
||||||
cleanup();
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
program = CL_CHECK2(clCreateProgramWithSource(
|
||||||
|
context, 1, (const char**)&kernel_bin, &kernel_size, &_err));
|
||||||
|
#else
|
||||||
|
if (0 != read_kernel_file("kernel.pocl", &kernel_bin, &kernel_size))
|
||||||
|
return -1;
|
||||||
|
program = CL_CHECK2(clCreateProgramWithBinary(
|
||||||
|
context, 1, &device_id, &kernel_size, (const uint8_t**)&kernel_bin, NULL, &_err));
|
||||||
|
#endif
|
||||||
|
|
||||||
// Build program
|
// Build program
|
||||||
CL_CHECK(clBuildProgram(program, 1, &device_id, NULL, NULL, NULL));
|
CL_CHECK(clBuildProgram(program, 1, &device_id, NULL, NULL, NULL));
|
||||||
|
|||||||
Reference in New Issue
Block a user