Molham-Talal / ocl-emu

Automatically exported from code.google.com/p/ocl-emu
0 stars 0 forks source link

callCL won't run on cpu or gpu #2

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,
when I trying to run HelloCL sample app which is in ocl_emu package
it do not run on cpu or gpu. Only gpu_emu success. 

Here is output from HelloCL app:
[output]
Hello OpenCl App

gpu_emu run
Hello, I'm an OpenCl GPU EMULATOR multi-core device. my position right now is x=
7, y=7 in the group x=0 y=0

cpu run
Error: clBuildProgram failed. Error code : CL_INVALID_BUILD_OPTIONS

gpu run
Error: clBuildProgram failed. Error code : CL_INVALID_BUILD_OPTIONS
Done
Passed!
[/output]

What am i doing wrong ? 
I am using the latest AMD SDK and ocl emu from ocl_emu-092911.zip

Thanks, Martin

Original issue reported on code.google.com by xBajci on 2 Dec 2011 at 12:48

GoogleCodeExporter commented 8 years ago
SIR xBajci,

  i AM PAVAN WHO IS WORKING ON OPENCL,I HAVE SOME DOUGHTS IN WHICH YOU CAN only CLEAR ME.IF POSSIBLE CAN YOU SEND YOUR EMAIL address TO MY MAIL ,that is pavan0712@gmail.com.if you send your mail address i will be in contact with you.

Original comment by pavan0...@gmail.com on 7 Dec 2011 at 7:10

GoogleCodeExporter commented 8 years ago
I assume it can run only on AMD CPU's and AMD GPU's. I am working on PC with 
intel processor and AMD graphic card so I expect it should work at least on gpu 
( callCL("gpu"),...) ). But it doesn't. 
Could someone help me with this problem ?

Martin

Original comment by xBajci on 9 Dec 2011 at 4:04

GoogleCodeExporter commented 8 years ago
In HelloCL_Kernels.cpp, follow the hint from KA, put in your correct location, 
e.g.
#define USE_MYLOCATION
#ifdef USE_MYLOCATION //NSA:mb
#include "C:\Users\Matthew\Documents\AMD 
APP\ocl_emu\opencl_emu\clemu\clemu_opencl.h"
#else
#include "clemu_opencl.h"
#endif

In runCL.cpp, make these changes:
#if 0 //NSA:mb turn off the include paths, since neither of them work to allow 
the clemu_opencl.h to be included
    sprintf_s(Options,512," -I \"%s\"", root_location); 
    if ( _program_location )
    {
        sprintf_s(Options,512,"%s -I \"%s\"", Options, _program_location);
    }
#endif

        strcat_s(Options, 256, " -D CPU_IMPL=1 "); //NSA:mb add space after -D, per OpenCLv1.1 section 5.6.3.1

This allowed me to run both gpu_emu and cpu versions:
Hello OpenCl App

gpu_emu run
Hello, I'm an OpenCl GPU EMULATOR multi-core device. my position right now is x=
7, y=7 in the group x=0 y=0

cpu run
Hello, I'm an OpenCl CPU multi-core device. my position right now is x=7, y=7 in
 the group x=0 y=0

Original comment by matthewe...@gmail.com on 11 Jan 2012 at 6:28

GoogleCodeExporter commented 8 years ago
Oops, forgot to mention that these changes were run on an Intel Win7 64-bit 
laptop, with AMD APP SDK 2.6 installed. There is no gpu in my system.

Original comment by matthewe...@gmail.com on 11 Jan 2012 at 6:31