Create a stringify example, instead of loading the .cl file from disk, include it as a string.

The kernel in the .cl file is also compiled by the native C++ cpu compiler, when using MiniCL.
When you want to debug the kernel using MiniCL, and want to put breakpoints, it is best to:

1) enabled the define #define DEBUG_MINICL_KERNELS 1 in Bullet/src/BulletMultiThreaded/MiniCL.cpp
2) temporarily remove the stringify lines in the .cl kernel, because it prevents the debugger from finding the right line.
This commit is contained in:
erwin.coumans
2010-06-25 22:21:18 +00:00
parent b884554a8f
commit 8bf91f735c
5 changed files with 69 additions and 30 deletions

View File

@@ -1,3 +1,16 @@
#ifndef GUID_ARG
#define GUID_ARG
#endif
#ifndef MSTRINGIFY
#define MSTRINGIFY(A) A
#endif
MSTRINGIFY(
/*
Bullet Continuous Collision Detection and Physics Library, http://bulletphysics.org
Copyright (C) 2006 - 2009 Sony Computer Entertainment Inc.
@@ -13,10 +26,7 @@ subject to the following restrictions:
3. This notice may not be removed or altered from any source distribution.
*/
///GUID_ARG is only used by MiniCL to pass in the guid used by its get_global_id implementation
#ifndef GUID_ARG
#define GUID_ARG
#endif
///////////////////////////////////////////////////
// OpenCL Kernel Function for element by element vector addition
@@ -47,3 +57,4 @@ __kernel void VectorAdd(__global const float8* a, __global const float8* b, __gl
c[get_global_id(0)] = f8Out;
}
);