fix Linux build
This commit is contained in:
@@ -16,6 +16,11 @@ subject to the following restrictions:
|
||||
|
||||
|
||||
#include "OpenGLInclude.h"
|
||||
|
||||
#ifndef glDrawElementsInstanced
|
||||
#define glDrawElementsInstanced glDrawElementsInstancedARB
|
||||
#endif
|
||||
|
||||
#include "GLInstancingRenderer.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
@@ -41,7 +41,7 @@ bool gDebugSkipLoadingBinary = false;
|
||||
|
||||
#include <assert.h>
|
||||
#define b3Assert assert
|
||||
#ifdef __APPLE__
|
||||
#ifndef _WIN32
|
||||
#include <sys/stat.h>
|
||||
|
||||
#endif
|
||||
@@ -752,7 +752,6 @@ cl_program b3OpenCLUtils_compileCLProgramFromString(cl_context clContext, cl_dev
|
||||
|
||||
#else
|
||||
fileUpToDate = true;
|
||||
#ifdef __APPLE__
|
||||
if (mkdir(sCachedBinaryPath,0777) == -1)
|
||||
{
|
||||
}
|
||||
@@ -760,7 +759,6 @@ cl_program b3OpenCLUtils_compileCLProgramFromString(cl_context clContext, cl_dev
|
||||
{
|
||||
b3Printf("Succesfully created cache directory: %s\n", sCachedBinaryPath);
|
||||
}
|
||||
#endif
|
||||
#endif //_WIN32
|
||||
}
|
||||
|
||||
@@ -873,10 +871,9 @@ cl_program b3OpenCLUtils_compileCLProgramFromString(cl_context clContext, cl_dev
|
||||
|
||||
size_t program_length = kernelSource ? strlen(kernelSource) : 0;
|
||||
#ifdef MAC //or __APPLE__?
|
||||
char* flags = "-cl-mad-enable -DMAC -DGUID_ARG";
|
||||
char* flags = "-cl-mad-enable -DMAC ";
|
||||
#else
|
||||
//const char* flags = "-DGUID_ARG= -fno-alias";
|
||||
const char* flags = "-DGUID_ARG= ";
|
||||
const char* flags = "";
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -164,9 +164,10 @@ public:
|
||||
//create a new OpenCL buffer
|
||||
size_t memSizeInBytes = sizeof(T)*_Count;
|
||||
cl_mem buf = clCreateBuffer(m_clContext, CL_MEM_READ_WRITE, memSizeInBytes, NULL, &ciErrNum);
|
||||
b3Assert(ciErrNum==CL_SUCCESS);
|
||||
if (ciErrNum!=CL_SUCCESS)
|
||||
{
|
||||
b3Error("OpenCL out-of-memory\n");
|
||||
b3Assert(0);
|
||||
_Count = 0;
|
||||
result = false;
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ int main(int argc, char* argv[])
|
||||
b3OpenCLUtils::printDeviceInfo(dev);
|
||||
|
||||
|
||||
b3OpenCLArray<char*> memTester(g_cxMainContext,g_cqCommandQue,0,true);
|
||||
b3OpenCLArray<char> memTester(g_cxMainContext,g_cqCommandQue,0,true);
|
||||
int maxMem = 8192;
|
||||
bool result=true;
|
||||
for (size_t i=1;result;i++)
|
||||
@@ -124,7 +124,7 @@ int main(int argc, char* argv[])
|
||||
oclCHECKERROR(ciErrNum, CL_SUCCESS);
|
||||
//normally you would create and execute kernels using this command queue
|
||||
|
||||
b3OpenCLArray<char*> memTester(g_cxMainContext,g_cqCommandQue,0,true);
|
||||
b3OpenCLArray<char> memTester(g_cxMainContext,g_cqCommandQue,0,true);
|
||||
int maxMem = 8192;
|
||||
bool result=true;
|
||||
for (size_t i=1;result;i++)
|
||||
|
||||
Reference in New Issue
Block a user