summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInderpreet Singh <[email protected]>2012-10-16 17:18:50 -0800
committerAndrew Boktor <[email protected]>2014-08-14 13:49:21 -0700
commit6405de1556cc50fd4feb3445272945a037e37423 (patch)
tree2124c1127a5630a919cd5da1b9ebea9f1479ed4f
parent1ade3b340c72f65fe01735df0748e13d4c026998 (diff)
Integrated in CL14390.
Fixed clCreateProgramWithSource to accept NULL or 0 as string length parameter Fixed replacement of printf modifiers when compiling OpenCL code (e.g. '%f') [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 14391]
-rw-r--r--CHANGES6
-rw-r--r--libopencl/opencl_runtime_api.cc8
2 files changed, 10 insertions, 4 deletions
diff --git a/CHANGES b/CHANGES
index f0e6e9c..5e4d93f 100644
--- a/CHANGES
+++ b/CHANGES
@@ -47,10 +47,12 @@ Version 3.1.1+edits (development branch) versus 3.1.1
instruction or not showing up at all. This should correct a bug where the
instruction addresses in ptxplus are different than sass. They need to be
the same for the brx ptxplus instruction to work.
- - Fixed a bug where the L2 cache was modelling write-back for local writes
+ - Fixed a bug where the L2 cache was modelling write-back for local writes
and write-evict for global writes - Should be write-back for all writes.
- Fixed bug that was causing undetermistic kernel end detection inside the
- simulation thread.
+ simulation thread.
+ - Fixed clCreateProgramWithSource to accept NULL or 0 as string length parameter
+ - Fixed replacement of printf modifiers when compiling OpenCL code (e.g. '%f')
Version 3.1.1 versus 3.1.0
- Add checks to top level makefile to ensure setup_environment is run and checks to
diff --git a/libopencl/opencl_runtime_api.cc b/libopencl/opencl_runtime_api.cc
index be2fdd0..5506ea4 100644
--- a/libopencl/opencl_runtime_api.cc
+++ b/libopencl/opencl_runtime_api.cc
@@ -391,7 +391,11 @@ _cl_program::_cl_program( cl_context context,
{
m_context = context;
for( cl_uint i=0; i<count; i++ ) {
- unsigned len = lengths[i];
+ unsigned len;
+ if(lengths != NULL and lengths[i] > 0)
+ len = lengths[i];
+ else
+ len = strlen(strings[i]);
char *tmp = (char*)malloc(len+1);
memcpy(tmp,strings[i],len);
tmp[len] = 0;
@@ -461,7 +465,7 @@ void _cl_program::Build(const char *options)
printf(" Ensure you have write permission to the simulation directory\n");
exit(1);
}
- fprintf(fp,source);
+ fputs(source,fp);
fclose(fp);
char commandline[1024];