Quantcast
Channel: Intel® Software - OpenCL*
Viewing all articles
Browse latest Browse all 1182

Intel® SDK for OpenCL* for 2013 manual and clCreateProgramWithBinary

$
0
0

I'm using your MedianFilter sample with VS2010 amd trying to create a

c following the user manual..  First, a minor not, theres a typo in the manual where you refer to

clCreateProgramFromBinary.  I assume you mean

clCreateProgramWithBinary.

More importantly,  I set in MedianFilter properties-Intel SDK for OpenCL Applications-General options the option to gnerate asm, llvm and ir options.

The "Command Line" shows that the options were set; but no .ir file is emmitted, and in the output window showing the output from Build I get

1>------ Rebuild All started: Project: MedianFilter, Configuration: Debug Win32 ------

1>Build started 9/16/2013 3:35:17 PM.

1>_PrepareForClean:

1>  Deleting file "Win32\Debug\MedianFilter.lastbuildstate".

1>InitializeBuildStatus:

1>  Creating "Win32\Debug\MedianFilter.unsuccessfulbuild" because "AlwaysCreate" was specified.

1>_Intel_OpenCL_Build_Rules:

1>  Preprocessing: MedianFilter.cl

1>ClCompile:

1>  utils.cpp

1>  stdafx.cpp

1>  MedianFilter.cpp

1>c:\users\sm\desktop\intel-ocl-median-filter\medianfilter\medianfilter.cpp(146): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(234) : see declaration of 'fopen'

1>c:\users\sm\desktop\intel-ocl-median-filter\medianfilter\medianfilter.cpp(165): warning C4101: 'lSize1' : unreferenced local variable

1>  Generating Code...

1>Manifest:

1>  Deleting file "Win32\Debug\MedianFilter.exe.embed.manifest".

1>LinkEmbedManifest:

1>  MedianFilter_SA.vcxproj -> C:\Users\sm\Desktop\intel-ocl-median-filter\MedianFilter\\..\Win32\Debug\MedianFilter.exe

1>PostBuildEvent:

1>          1 file(s) copied.

1>FinalizeBuildStatus:

1>  Deleting file "Win32\Debug\MedianFilter.unsuccessfulbuild".

1>  Touching "Win32\Debug\MedianFilter.lastbuildstate".

1>

1>Build succeeded.

1>

1>Time Elapsed 00:00:02.74

========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

with none of the entries your manual shows to click on to view the asm or llvm outputs.

 

Furthermore if I create the binary using the Intel Kernel builder, and then trying to use it in clCreateProgramWithBinary as follows,

FILE* fp = fopen("c:\\Users\\sm\\Desktop\\intel-ocl-median-filter\\MedianFilter\\Win32\\Debug\\MedianFilterlib.ir","r");

fseek (fp , 0 , SEEK_END);

constsize_t lSize = ftell(fp);

rewind(fp);

unsignedchar* buffer;

buffer = (unsignedchar*) malloc (lSize);

fread(buffer, 1, lSize, fp);

fclose(fp);

cl_int status;

cl_int ciErr1;

g_program =clCreateProgramWithBinary(g_context, 1, (constcl_device_id *)devices,&lSize,(constunsignedchar**)&buffer,&status,&ciErr1);

constchar* error_string2 = OCL_GetErrorString(ciErr1);

size_t lSize1;

ciErr1 = clGetProgramInfo (g_program,CL_PROGRAM_KERNEL_NAMES,100,buffer,NULL);

constchar* error_string1 = OCL_GetErrorString(ciErr1);

then g_program looks legitmate, error string show CL_Success,  BUT clGetProgramInfo or any other attempt to use  g_program returns an

CL_INVALID_PROGRAM_EXECUTABLE!!

I'm running on CPU (Sandy Bridge, VS2010 and Windows 7.   What am I doing wrong, and why does the output from build not create the .ir file and not match the infro displayed in the manual???

 


Viewing all articles
Browse latest Browse all 1182

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>