Hello,
I am developping a short application to downsampling images on my samsung alpha.
I use OpenCL to develop on my GPU.
I have a problem when I use a sampler_t. Just when I decrare a sampler_t variable in my kernel, the program crash and gave me that error:
<CODE>
12-03 13:50:05.411: E/AndroidRuntime(990): FATAL EXCEPTION: main
12-03 13:50:05.411: E/AndroidRuntime(990): Process: com.example.subsamplecamera, PID: 990
12-03 13:50:05.411: E/AndroidRuntime(990): java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
12-03 13:50:05.411: E/AndroidRuntime(990): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
12-03 13:50:05.411: E/AndroidRuntime(990): at dalvik.system.NativeStart.main(Native Method)
12-03 13:50:05.411: E/AndroidRuntime(990): Caused by: java.lang.reflect.InvocationTargetException
12-03 13:50:05.411: E/AndroidRuntime(990): at java.lang.reflect.Method.invokeNative(Native Method)
12-03 13:50:05.411: E/AndroidRuntime(990): at java.lang.reflect.Method.invoke(Method.java:515)
12-03 13:50:05.411: E/AndroidRuntime(990): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
12-03 13:50:05.411: E/AndroidRuntime(990): ... 2 more
12-03 13:50:05.411: E/AndroidRuntime(990): Caused by: java.lang.Exception: @decode: clBuildProgram -11
12-03 13:50:05.411: E/AndroidRuntime(990): at com.example.subsamplecamera.MainActivity.compileKernels(Native Method)
12-03 13:50:05.411: E/AndroidRuntime(990): at com.example.subsamplecamera.MainActivity.onSurfaceTextureAvailable(MainActivity.java:119)
12-03 13:50:05.411: E/AndroidRuntime(990): at android.view.TextureView.getHardwareLayer(TextureView.java:396)
12-03 13:50:05.411: E/AndroidRuntime(990): at android.view.View.getDisplayList(View.java:14215)
12-03 13:50:05.411: E/AndroidRuntime(990): at android.view.View.getDisplayList(View.java:14292)
12-03 13:50:05.411: E/AndroidRuntime(990): at android.view.View.draw(View.java:15070)
12-03 13:50:05.411: E/AndroidRuntime(990): at android.view.ViewGroup.drawChild(ViewGroup.java:3340)
12-03 13:50:05.411: E/AndroidRuntime(990): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3176)
12-03 13:50:05.411: E/AndroidRuntime(990): at android.view.View.getDisplayList(View.java:14245)
12-03 13:50:05.411: E/AndroidRuntime(990): at android.view.View.draw(View.java:15359)
12-03 13:50:05.411: E/AndroidRuntime(990): at android.widget.FrameLayout.draw(FrameLayout.java:472)
12-03 13:50:05.411: E/AndroidRuntime(990): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2621)
12-03 13:50:05.411: E/AndroidRuntime(990): at android.view.View.getDisplayList(View.java:14250)
12-03 13:50:05.411: E/AndroidRuntime(990): at android.view.HardwareRenderer$GlRenderer.buildDisplayList(HardwareRenderer.java:1597)
12-03 13:50:05.411: E/AndroidRuntime(990): at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:1469)
12-03 13:50:05.411: E/AndroidRuntime(990): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2786)
12-03 13:50:05.411: E/AndroidRuntime(990): at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2652)
12-03 13:50:05.411: E/AndroidRuntime(990): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2223)
12-03 13:50:05.411: E/AndroidRuntime(990): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1259)
12-03 13:50:05.411: E/AndroidRuntime(990): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6537)
12-03 13:50:05.411: E/AndroidRuntime(990): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:813)
12-03 13:50:05.411: E/AndroidRuntime(990): at android.view.Choreographer.doCallbacks(Choreographer.java:613)
12-03 13:50:05.411: E/AndroidRuntime(990): at android.view.Choreographer.doFrame(Choreographer.java:583)
12-03 13:50:05.411: E/AndroidRuntime(990): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:799)
12-03 13:50:05.411: E/AndroidRuntime(990): at android.os.Handler.handleCallback(Handler.java:733)
12-03 13:50:05.411: E/AndroidRuntime(990): at android.os.Handler.dispatchMessage(Handler.java:95)
12-03 13:50:05.411: E/AndroidRuntime(990): at android.os.Looper.loop(Looper.java:146)
12-03 13:50:05.411: E/AndroidRuntime(990): at android.app.ActivityThread.main(ActivityThread.java:5635)
12-03 13:50:05.411: E/AndroidRuntime(990): ... 5 more
</CODE>
Can someone give me a hand?
Best regard.
Your program returns -11 (CL_BUILD_PROGRAM_FAILURE), you need to check the Build Log to find out the cause of the failure:
char *buffer = NULL;size_t len;CHECK_CL( clGetProgramBuildInfo( program, device, CL_PROGRAM_BUILD_LOG, 0, NULL, &len ) );buffer = (char*) malloc(len);CHECK_CL( clGetProgramBuildInfo( program, device, CL_PROGRAM_BUILD_LOG, len, buffer, &len ));std::cout<<"\nBuild log:\n\t["<<buffer<<"]"<<std::endl;free(buffer);
char *buffer = NULL;
size_t len;
CHECK_CL( clGetProgramBuildInfo( program, device, CL_PROGRAM_BUILD_LOG, 0, NULL, &len ) );
buffer = (char*) malloc(len);
CHECK_CL( clGetProgramBuildInfo( program, device, CL_PROGRAM_BUILD_LOG, len, buffer, &len ));
std::cout<<"\nBuild log:\n\t["<<buffer<<"]"<<std::endl;
free(buffer);
Hope this helps,
Anthony
I can get information because the fatal error append when this line is execute:
program.build(devices);
Nothing happend then, the program crash.
In fact I found a piece of program go get information so this is what I have:
12-03 15:33:46.291: E/JNIProcessor(13974): Build log
12-03 15:33:46.291: E/JNIProcessor(13974):
12-03 15:33:46.291: E/JNIProcessor(13974): Build status
12-03 15:33:46.291: E/JNIProcessor(13974): 0
12-03 15:33:46.291: E/JNIProcessor(13974): Build option
12-03 15:33:46.296: D/AndroidRuntime(13974): Shutting down VM
12-03 15:33:46.296: W/dalvikvm(13974): threadid=1: thread exiting with uncaught exception (group=0x4187fc08)
12-03 15:33:46.296: E/AndroidRuntime(13974): FATAL EXCEPTION: main
12-03 15:33:46.296: E/AndroidRuntime(13974): Process: com.example.subsamplecamera, PID: 13974
12-03 15:33:46.296: E/AndroidRuntime(13974): java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
12-03 15:33:46.296: E/AndroidRuntime(13974): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
12-03 15:33:46.296: E/AndroidRuntime(13974): at dalvik.system.NativeStart.main(Native Method)
12-03 15:33:46.296: E/AndroidRuntime(13974): Caused by: java.lang.reflect.InvocationTargetException
12-03 15:33:46.296: E/AndroidRuntime(13974): at java.lang.reflect.Method.invokeNative(Native Method)
12-03 15:33:46.296: E/AndroidRuntime(13974): at java.lang.reflect.Method.invoke(Method.java:515)
12-03 15:33:46.296: E/AndroidRuntime(13974): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
12-03 15:33:46.296: E/AndroidRuntime(13974): ... 2 more
12-03 15:33:46.296: E/AndroidRuntime(13974): Caused by: java.lang.Exception: @decode: clBuildProgram -11
12-03 15:33:46.296: E/AndroidRuntime(13974): at com.example.subsamplecamera.MainActivity.compileKernels(Native Method)
12-03 15:33:46.296: E/AndroidRuntime(13974): at com.example.subsamplecamera.MainActivity.onSurfaceTextureAvailable(MainActivity.java:119)
12-03 15:33:46.296: E/AndroidRuntime(13974): at android.view.TextureView.getHardwareLayer(TextureView.java:396)
12-03 15:33:46.296: E/AndroidRuntime(13974): at android.view.View.getDisplayList(View.java:14215)
12-03 15:33:46.296: E/AndroidRuntime(13974): at android.view.View.getDisplayList(View.java:14292)
12-03 15:33:46.296: E/AndroidRuntime(13974): at android.view.View.draw(View.java:15070)
12-03 15:33:46.296: E/AndroidRuntime(13974): at android.view.ViewGroup.drawChild(ViewGroup.java:3340)
12-03 15:33:46.296: E/AndroidRuntime(13974): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3176)
12-03 15:33:46.296: E/AndroidRuntime(13974): at android.view.View.getDisplayList(View.java:14245)
12-03 15:33:46.296: E/AndroidRuntime(13974): at android.view.View.draw(View.java:15359)
12-03 15:33:46.296: E/AndroidRuntime(13974): at android.widget.FrameLayout.draw(FrameLayout.java:472)
12-03 15:33:46.296: E/AndroidRuntime(13974): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2621)
12-03 15:33:46.296: E/AndroidRuntime(13974): at android.view.View.getDisplayList(View.java:14250)
12-03 15:33:46.296: E/AndroidRuntime(13974): at android.view.HardwareRenderer$GlRenderer.buildDisplayList(HardwareRenderer.java:1597)
12-03 15:33:46.296: E/AndroidRuntime(13974): at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:1469)
12-03 15:33:46.296: E/AndroidRuntime(13974): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2786)
12-03 15:33:46.296: E/AndroidRuntime(13974): at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2652)
12-03 15:33:46.296: E/AndroidRuntime(13974): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2223)
12-03 15:33:46.296: E/AndroidRuntime(13974): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1259)
12-03 15:33:46.296: E/AndroidRuntime(13974): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6537)
12-03 15:33:46.296: E/AndroidRuntime(13974): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:813)
12-03 15:33:46.296: E/AndroidRuntime(13974): at android.view.Choreographer.doCallbacks(Choreographer.java:613)
12-03 15:33:46.296: E/AndroidRuntime(13974): at android.view.Choreographer.doFrame(Choreographer.java:583)
12-03 15:33:46.296: E/AndroidRuntime(13974): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:799)
12-03 15:33:46.296: E/AndroidRuntime(13974): at android.os.Handler.handleCallback(Handler.java:733)
12-03 15:33:46.296: E/AndroidRuntime(13974): at android.os.Handler.dispatchMessage(Handler.java:95)
12-03 15:33:46.296: E/AndroidRuntime(13974): at android.os.Looper.loop(Looper.java:146)
12-03 15:33:46.296: E/AndroidRuntime(13974): at android.app.ActivityThread.main(ActivityThread.java:5635)
12-03 15:33:46.296: E/AndroidRuntime(13974): ... 5 more
12-03 15:33:46.316: I/Process(13974): Sending signal. PID: 13974 SIG: 9
I don't see what crash you're talking about: the logcat message clearly indicates an exception has been thrown (This isn't a crash)
I therefore assume you're using the C++11 Khronos wrapper and you've manually enabled the exceptions therefore either:
- Don't enable the exceptions and check the error codes by hand.
- Handle the exceptions in your code:
try{ program.build(options);}catch( cl::Error err){ std::stringstream ss; std::string str; ss << err.what() << "(" << err.err() << ")" << std::endl; ss << "Build Options:\t" << program.getBuildInfo<CL_PROGRAM_BUILD_OPTIONS>(device) << std::endl; ss << "Build Log:\t " << program.getBuildInfo<CL_PROGRAM_BUILD_LOG>(device) << std::endl; str = ss.str(); std::cout<<" ERROR "<< str<<std::endl; throw std::runtime_error(str.c_str()); // Re-throw exception to stop program execution}
try
{
program.build(options);
}
catch( cl::Error err)
std::stringstream ss;
std::string str;
ss << err.what() << "(" << err.err() << ")" << std::endl;
ss << "Build Options:\t" << program.getBuildInfo<CL_PROGRAM_BUILD_OPTIONS>(device) << std::endl;
ss << "Build Log:\t " << program.getBuildInfo<CL_PROGRAM_BUILD_LOG>(device) << std::endl;
str = ss.str();
std::cout<<" ERROR "<< str<<std::endl;
throw std::runtime_error(str.c_str()); // Re-throw exception to stop program execution
Looks like you're printing the log then clBuildProgram throw an exception which suggests you're checking the log before you actually called clBuildProgram which would explain why the log is empty. (Or did you catch the exception, print the log, then re-threw the exception ?)
It would be easier if you pasted your code here.
Sorry for the late response.
Here is the error I get:
12-09 20:50:53.267: E/JNIProcessor(1272):
^12-09 20:50:53.267: E/JNIProcessor(1272): <source>:44:41: warning: double precision constant requires cl_khr_fp64, casting to single precision12-09 20:50:53.267: E/JNIProcessor(1272): out[inIdx] = 255-(0.403936*(u-128)+0.838316*(v-128)+(y-16));12-09 20:50:53.267: E/JNIProcessor(1272): ^12-09 20:50:53.267: E/JNIProcessor(1272): <source>:57:33: warning: double precision constant requires cl_khr_fp64, casting to single precision12-09 20:50:53.267: E/JNIProcessor(1272): float x0 = src[ix-2+(iy)*w]/16.0;12-09 20:50:53.267: E/JNIProcessor(1272): 12-09 20:50:53.267: D/AndroidRuntime(1272): Shutting down VM12-09 20:50:53.267: W/dalvikvm(1272): threadid=1: thread exiting with uncaught exception (group=0x4187fc08)12-09 20:50:53.272: E/AndroidRuntime(1272): FATAL EXCEPTION: main12-09 20:50:53.272: E/AndroidRuntime(1272): Process: com.example, PID: 127212-09 20:50:53.272: E/AndroidRuntime(1272): java.lang.RuntimeException: java.lang.reflect.InvocationTargetException12-09 20:50:53.272: E/AndroidRuntime(1272): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)12-09 20:50:53.272: E/AndroidRuntime(1272): at dalvik.system.NativeStart.main(Native Method)12-09 20:50:53.272: E/AndroidRuntime(1272): Caused by: java.lang.reflect.InvocationTargetException12-09 20:50:53.272: E/AndroidRuntime(1272): at java.lang.reflect.Method.invokeNative(Native Method)12-09 20:50:53.272: E/AndroidRuntime(1272): at java.lang.reflect.Method.invoke(Method.java:515)12-09 20:50:53.272: E/AndroidRuntime(1272): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)12-09 20:50:53.272: E/AndroidRuntime(1272): ... 2 more12-09 20:50:53.272: E/AndroidRuntime(1272): Caused by: java.lang.Exception: @decode: clBuildProgram -1112-09 20:50:53.272: E/AndroidRuntime(1272): at com.example.MainActivity.compileKernels(Native Method)12-09 20:50:53.272: E/AndroidRuntime(1272): at com.example.MainActivity.onSurfaceTextureAvailable(MainActivity.java:124)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.TextureView.getHardwareLayer(TextureView.java:396)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.View.getDisplayList(View.java:14215)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.View.getDisplayList(View.java:14292)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.View.draw(View.java:15070)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.ViewGroup.drawChild(ViewGroup.java:3340)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3176)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.View.getDisplayList(View.java:14245)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.View.getDisplayList(View.java:14292)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.View.draw(View.java:15070)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.ViewGroup.drawChild(ViewGroup.java:3340)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3176)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.View.getDisplayList(View.java:14245)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.View.getDisplayList(View.java:14292)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.View.draw(View.java:15070)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.ViewGroup.drawChild(ViewGroup.java:3340)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3176)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.View.getDisplayList(View.java:14245)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.View.getDisplayList(View.java:14292)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.View.draw(View.java:15070)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.ViewGroup.drawChild(ViewGroup.java:3340)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3176)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.View.draw(View.java:15359)12-09 20:50:53.272: E/AndroidRuntime(1272): at com.android.internal.widget.ActionBarOverlayLayout.draw(ActionBarOverlayLayout.java:466)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.View.getDisplayList(View.java:14250)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.View.getDisplayList(View.java:14292)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.View.draw(View.java:15070)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.ViewGroup.drawChild(ViewGroup.java:3340)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3176)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.View.draw(View.java:15359)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.widget.FrameLayout.draw(FrameLayout.java:472)12-09 20:50:53.272: E/AndroidRuntime(1272): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2621)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.View.getDisplayList(View.java:14250)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.View.getDisplayList(View.java:14292)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.HardwareRenderer$GlRenderer.buildDisplayList(HardwareRenderer.java:1597)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:1469)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2786)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2652)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2223)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1259)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6537)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:813)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.Choreographer.doCallbacks(Choreographer.java:613)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.Choreographer.doFrame(Choreographer.java:583)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:799)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.os.Handler.handleCallback(Handler.java:733)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.os.Handler.dispatchMessage(Handler.java:95)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.os.Looper.loop(Looper.java:146)12-09 20:50:53.272: E/AndroidRuntime(1272): at android.app.ActivityThread.main(ActivityThread.java:5635)12-09 20:50:53.272: E/AndroidRuntime(1272): ... 5 more
To fix the warnings you need to add "f" at the end of your float constants. "3.0f"
But these are only warnings so I doubt this is the reason why the build fails.
Do you have any attribute in front of your kernel ? Could you please share the kernel with us ? Or maybe could you try to compile your kernel using the offline compiler to see if it shows any error ? http://malideveloper.arm.com/resources/tools/mali-offline-compiler/
Thanks,
Sorry I made a mistake during the copy.
Here is the full build log:
12-09 20:50:53.167: I/JNIProcessor(1272): @compileKernels
12-09 20:50:53.267: I/JNIProcessor(1272): @compileKernels error
12-09 20:50:53.267: E/JNIProcessor(1272): @compileKernels error <source>:13:20: warning: double precision constant requires cl_khr_fp64, casting to single precision
12-09 20:50:53.267: E/JNIProcessor(1272): int val = 255-(0.403936*u+0.838316*v+y);
^12-09 20:50:53.267: E/JNIProcessor(1272): <source>:13:31: warning: double precision constant requires cl_khr_fp64, casting to single precision12-09 20:50:53.267: E/JNIProcessor(1272): int val = 255-(0.403936*u+0.838316*v+y);12-09 20:50:53.267: E/JNIProcessor(1272): ^12-09 20:50:53.267: E/JNIProcessor(1272): <source>:24:11: error: using invalid qualifier with sampler type12-09 20:50:53.267: E/JNIProcessor(1272): sampler_t srcSampler;12-09 20:50:53.267: E/JNIProcessor(1272): ^12-09 20:50:53.267: E/JNIProcessor(1272): <source>:44:24: warning: double precision constant requires cl_khr_fp64, casting to single precision12-09 20:50:53.267: E/JNIProcessor(1272): out[inIdx] = 255-(0.403936*(u-128)+0.838316*(v-128)+(y-16));12-09 20:50:53.267: E/JNIProcessor(1272): ^12-09 20:50:53.267: E/JNIProcessor(1272): <source>:44:41: warning: double precision constant requires cl_khr_fp64, casting to single precision12-09 20:50:53.267: E/JNIProcessor(1272): out[inIdx] = 255-(0.403936*(u-128)+0.838316*(v-128)+(y-16));12-09 20:50:53.267: E/JNIProcessor(1272): ^12-09 20:50:53.267: E/JNIProcessor(1272): <source>:57:33: warning: double precision constant requires cl_khr_fp64, casting to single precision12-09 20:50:53.267: E/JNIProcessor(1272): float x0 = src[ix-2+(iy)*w]/16.0;12-09 20:50:53.267: E/JNIProcessor(1272): 12-09 20:50:53.267: E/JNIProcessor(1272): @compileKernels error <source>:13:20: warning: double precision constant requires cl_khr_fp64, casting to single precision12-09 20:50:53.267: E/JNIProcessor(1272): int val = 255-(0.403936*u+0.838316*v+y);12-09 20:50:53.267: E/JNIProcessor(1272): ^12-09 20:50:53.267: E/JNIProcessor(1272): <source>:13:31: warning: double precision constant requires cl_khr_fp64, casting to single precision12-09 20:50:53.267: E/JNIProcessor(1272): int val = 255-(0.403936*u+0.838316*v+y);12-09 20:50:53.267: E/JNIProcessor(1272): ^12-09 20:50:53.267: E/JNIProcessor(1272): <source>:24:11: error: using invalid qualifier with sampler type12-09 20:50:53.267: E/JNIProcessor(1272): sampler_t srcSampler;12-09 20:50:53.267: E/JNIProcessor(1272): ^12-09 20:50:53.267: E/JNIProcessor(1272): <source>:44:24: warning: double precision constant requires cl_khr_fp64, casting to single precision12-09 20:50:53.267: E/JNIProcessor(1272): out[inIdx] = 255-(0.403936*(u-128)+0.838316*(v-128)+(y-16));12-09 20:50:53.267: E/JNIProcessor(1272): ^12-09 20:50:53.267: E/JNIProcessor(1272): <source>:44:41: warning: double precision constant requires cl_khr_fp64, casting to single precision12-09 20:50:53.267: E/JNIProcessor(1272): out[inIdx] = 255-(0.403936*(u-128)+0.838316*(v-128)+(y-16));12-09 20:50:53.267: E/JNIProcessor(1272): ^12-09 20:50:53.267: E/JNIProcessor(1272): <source>:57:33: warning: double precision constant requires cl_khr_fp64, casting to single precision12-09 20:50:53.267: E/JNIProcessor(1272): float x0 = src[ix-2+(iy)*w]/16.0;
12-09 20:50:53.267: E/JNIProcessor(1272): <source>:24:11: error: using invalid qualifier with sampler type
That's because the sampler has to be constant, for example:
const sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP | CLK_FILTER_NEAREST;
Regarding the warnings: like I said before you need to add "f" at the end of your float constants otherwise the compiler will think they are double values.
It works now.
Thank you very much.