File luxrays-after-001-clhpp.patch of Package luxrays
diff -urN luxrender-luxrays-8577ff287efb/include/luxrays/core/ocldevice.h luxrender-luxrays-clhpp/include/luxrays/core/ocldevice.h
--- luxrender-luxrays-8577ff287efb/include/luxrays/core/ocldevice.h 2022-11-11 21:26:31.811907177 +0900
+++ luxrender-luxrays-clhpp/include/luxrays/core/ocldevice.h 2022-11-11 21:33:02.095133503 +0900
@@ -103,7 +103,7 @@
}
bool IsAMDPlatform() const {
- cl::Platform platform = oclDevice.getInfo<CL_DEVICE_PLATFORM>();
+ cl::Platform platform(oclDevice.getInfo<CL_DEVICE_PLATFORM>());
return !strcmp(platform.getInfo<CL_PLATFORM_VENDOR>().c_str(), "Advanced Micro Devices, Inc.");
}
diff -urN luxrender-luxrays-8577ff287efb/include/luxrays/core/oclintersectiondevice.h luxrender-luxrays-clhpp/include/luxrays/core/oclintersectiondevice.h
--- luxrender-luxrays-8577ff287efb/include/luxrays/core/oclintersectiondevice.h 2022-11-11 21:26:31.811907177 +0900
+++ luxrender-luxrays-clhpp/include/luxrays/core/oclintersectiondevice.h 2022-11-11 21:33:02.095133503 +0900
@@ -48,7 +48,7 @@
virtual void Update(const DataSet *newDataSet) = 0;
virtual void EnqueueRayBuffer(cl::CommandQueue &oclQueue, const u_int kernelIndex,
cl::Buffer &rBuff, cl::Buffer &hBuff, const unsigned int rayCount,
- const VECTOR_CLASS<cl::Event> *events, cl::Event *event) = 0;
+ const cl::vector<cl::Event> *events, cl::Event *event) = 0;
const std::string &GetIntersectionKernelSource() { return intersectionKernelSource; }
virtual u_int SetIntersectionKernelArgs(cl::Kernel &kernel, const u_int argIndex) { return 0; }
@@ -101,7 +101,7 @@
void EnqueueTraceRayBuffer(cl::Buffer &rBuff, cl::Buffer &hBuff,
const unsigned int rayCount,
- const VECTOR_CLASS<cl::Event> *events, cl::Event *event,
+ const cl::vector<cl::Event> *events, cl::Event *event,
const u_int queueIndex = 0) {
// Enqueue the intersection kernel
oclQueues[queueIndex]->EnqueueTraceRayBuffer(rBuff, hBuff, rayCount, events, event);
@@ -153,7 +153,7 @@
void EnqueueTraceRayBuffer(cl::Buffer &rBuff, cl::Buffer &hBuff,
const unsigned int rayCount,
- const VECTOR_CLASS<cl::Event> *events, cl::Event *event) {
+ const cl::vector<cl::Event> *events, cl::Event *event) {
freeElem[0]->EnqueueTraceRayBuffer(rBuff, hBuff, rayCount, events, event);
statsTotalDataParallelRayCount += rayCount;
}
@@ -169,7 +169,7 @@
void EnqueueTraceRayBuffer(cl::Buffer &rBuff, cl::Buffer &hBuff,
const unsigned int rayCount,
- const VECTOR_CLASS<cl::Event> *events, cl::Event *event) {
+ const cl::vector<cl::Event> *events, cl::Event *event) {
device->kernels->EnqueueRayBuffer(*oclQueue, kernelIndex, rBuff, hBuff, rayCount, events, event);
}
diff -urN luxrender-luxrays-8577ff287efb/include/luxrays/utils/ocl.h luxrender-luxrays-clhpp/include/luxrays/utils/ocl.h
--- luxrender-luxrays-8577ff287efb/include/luxrays/utils/ocl.h 2015-10-06 17:56:47.000000000 +0900
+++ luxrender-luxrays-clhpp/include/luxrays/utils/ocl.h 2022-11-11 22:57:11.133878749 +0900
@@ -26,12 +26,12 @@
// To avoid reference to OpenCL 1.2 symbols in cl.hpp file
#define CL_USE_DEPRECATED_OPENCL_1_1_APIS
-#define __CL_ENABLE_EXCEPTIONS
+#define CL_HPP_ENABLE_EXCEPTIONS
#if defined(__APPLE__)
#include <OpenCL/cl.hpp>
#else
-#include <CL/cl.hpp>
+#include <CL/opencl.hpp>
#endif
namespace luxrays {
@@ -47,11 +47,11 @@
virtual cl::Program *Compile(cl::Context &context, cl::Device &device,
const std::string &kernelsParameters, const std::string &kernelSource,
- bool *cached, cl::STRING_CLASS *error) = 0;
+ bool *cached, cl::string *error) = 0;
static cl::Program *ForcedCompile(cl::Context &context, cl::Device &device,
const std::string &kernelsParameters, const std::string &kernelSource,
- cl::STRING_CLASS *error);
+ cl::string *error);
};
class oclKernelDummyCache : public oclKernelCache {
@@ -61,7 +61,7 @@
cl::Program *Compile(cl::Context &context, cl::Device &device,
const std::string &kernelsParameters, const std::string &kernelSource,
- bool *cached, cl::STRING_CLASS *error) {
+ bool *cached, cl::string *error) {
if (cached)
*cached = false;
@@ -76,7 +76,7 @@
cl::Program *Compile(cl::Context &context, cl::Device &device,
const std::string &kernelsParameters, const std::string &kernelSource,
- bool *cached, cl::STRING_CLASS *error);
+ bool *cached, cl::string *error);
private:
boost::unordered_map<std::string, cl::Program::Binaries> kernelCache;
@@ -91,7 +91,7 @@
cl::Program *Compile(cl::Context &context, cl::Device &device,
const std::string &kernelsParameters, const std::string &kernelSource,
- bool *cached, cl::STRING_CLASS *error);
+ bool *cached, cl::string *error);
static std::string HashString(const std::string &ss);
static u_int HashBin(const char *s, const size_t size);
diff -urN luxrender-luxrays-8577ff287efb/src/luxrays/accelerators/bvhaccel.cpp luxrender-luxrays-clhpp/src/luxrays/accelerators/bvhaccel.cpp
--- luxrender-luxrays-8577ff287efb/src/luxrays/accelerators/bvhaccel.cpp 2015-10-06 17:56:47.000000000 +0900
+++ luxrender-luxrays-clhpp/src/luxrays/accelerators/bvhaccel.cpp 2022-11-11 21:35:07.012936987 +0900
@@ -211,14 +211,14 @@
luxrays::ocl::KernelSource_triangle_funcs +
luxrays::ocl::KernelSource_bvh_types +
luxrays::ocl::KernelSource_bvh);
- cl::Program::Sources source(1, std::make_pair(code.c_str(), code.length()));
+ cl::Program::Sources source(1, code);
cl::Program program = cl::Program(oclContext, source);
try {
- VECTOR_CLASS<cl::Device> buildDevice;
+ cl::vector<cl::Device> buildDevice;
buildDevice.push_back(oclDevice);
program.build(buildDevice, opts.str().c_str());
} catch (cl::Error err) {
- cl::STRING_CLASS strError = program.getBuildInfo<CL_PROGRAM_BUILD_LOG>(oclDevice);
+ cl::string strError = program.getBuildInfo<CL_PROGRAM_BUILD_LOG>(oclDevice);
LR_LOG(deviceContext, "[OpenCL device::" << deviceName << "] BVH compilation error:\n" << strError.c_str());
throw err;
@@ -255,7 +255,7 @@
virtual void Update(const DataSet *newDataSet) { assert(false); }
virtual void EnqueueRayBuffer(cl::CommandQueue &oclQueue, const u_int kernelIndex,
cl::Buffer &rBuff, cl::Buffer &hBuff, const u_int rayCount,
- const VECTOR_CLASS<cl::Event> *events, cl::Event *event);
+ const cl::vector<cl::Event> *events, cl::Event *event);
virtual u_int SetIntersectionKernelArgs(cl::Kernel &kernel, const u_int argIndex);
@@ -266,7 +266,7 @@
void OpenCLBVHKernels::EnqueueRayBuffer(cl::CommandQueue &oclQueue, const u_int kernelIndex,
cl::Buffer &rBuff, cl::Buffer &hBuff, const u_int rayCount,
- const VECTOR_CLASS<cl::Event> *events, cl::Event *event) {
+ const cl::vector<cl::Event> *events, cl::Event *event) {
kernels[kernelIndex]->setArg(0, rBuff);
kernels[kernelIndex]->setArg(1, hBuff);
kernels[kernelIndex]->setArg(2, rayCount);
diff -urN luxrender-luxrays-8577ff287efb/src/luxrays/accelerators/mbvhaccel.cpp luxrender-luxrays-clhpp/src/luxrays/accelerators/mbvhaccel.cpp
--- luxrender-luxrays-8577ff287efb/src/luxrays/accelerators/mbvhaccel.cpp 2015-10-06 17:56:47.000000000 +0900
+++ luxrender-luxrays-clhpp/src/luxrays/accelerators/mbvhaccel.cpp 2022-11-11 21:36:03.715260116 +0900
@@ -380,14 +380,14 @@
luxrays::ocl::KernelSource_triangle_funcs +
luxrays::ocl::KernelSource_bvh_types +
luxrays::ocl::KernelSource_mbvh);
- cl::Program::Sources source(1, std::make_pair(code.c_str(), code.length()));
+ cl::Program::Sources source(1, code);
cl::Program program = cl::Program(oclContext, source);
try {
- VECTOR_CLASS<cl::Device> buildDevice;
+ cl::vector<cl::Device> buildDevice;
buildDevice.push_back(oclDevice);
program.build(buildDevice, opts.str().c_str());
} catch (cl::Error err) {
- cl::STRING_CLASS strError = program.getBuildInfo<CL_PROGRAM_BUILD_LOG>(oclDevice);
+ cl::string strError = program.getBuildInfo<CL_PROGRAM_BUILD_LOG>(oclDevice);
LR_LOG(deviceContext, "[OpenCL device::" << deviceName << "] MBVH compilation error:\n" << strError.c_str());
throw err;
@@ -437,7 +437,7 @@
virtual void Update(const DataSet *newDataSet) { assert(false); }
virtual void EnqueueRayBuffer(cl::CommandQueue &oclQueue, const u_int kernelIndex,
cl::Buffer &rBuff, cl::Buffer &hBuff, const u_int rayCount,
- const VECTOR_CLASS<cl::Event> *events, cl::Event *event);
+ const cl::vector<cl::Event> *events, cl::Event *event);
virtual u_int SetIntersectionKernelArgs(cl::Kernel &kernel, const u_int argIndex);
@@ -451,7 +451,7 @@
void OpenCLMBVHKernels::EnqueueRayBuffer(cl::CommandQueue &oclQueue, const u_int kernelIndex,
cl::Buffer &rBuff, cl::Buffer &hBuff, const u_int rayCount,
- const VECTOR_CLASS<cl::Event> *events, cl::Event *event) {
+ const cl::vector<cl::Event> *events, cl::Event *event) {
kernels[kernelIndex]->setArg(0, rBuff);
kernels[kernelIndex]->setArg(1, hBuff);
kernels[kernelIndex]->setArg(2, rayCount);
diff -urN luxrender-luxrays-8577ff287efb/src/luxrays/accelerators/mqbvhaccel.cpp luxrender-luxrays-clhpp/src/luxrays/accelerators/mqbvhaccel.cpp
--- luxrender-luxrays-8577ff287efb/src/luxrays/accelerators/mqbvhaccel.cpp 2015-10-06 17:56:47.000000000 +0900
+++ luxrender-luxrays-clhpp/src/luxrays/accelerators/mqbvhaccel.cpp 2022-11-11 21:36:41.027929399 +0900
@@ -76,14 +76,14 @@
luxrays::ocl::KernelSource_motionsystem_funcs +
luxrays::ocl::KernelSource_qbvh_types +
luxrays::ocl::KernelSource_mqbvh);
- cl::Program::Sources source(1, std::make_pair(code.c_str(), code.length()));
+ cl::Program::Sources source(1, code);
cl::Program program = cl::Program(oclContext, source);
try {
- VECTOR_CLASS<cl::Device> buildDevice;
+ cl::vector<cl::Device> buildDevice;
buildDevice.push_back(oclDevice);
program.build(buildDevice, opts.str().c_str());
} catch (cl::Error err) {
- cl::STRING_CLASS strError = program.getBuildInfo<CL_PROGRAM_BUILD_LOG>(oclDevice);
+ cl::string strError = program.getBuildInfo<CL_PROGRAM_BUILD_LOG>(oclDevice);
LR_LOG(deviceContext, "[OpenCL device::" << deviceName <<
"] MQBVH compilation error:\n" << strError.c_str());
throw err;
@@ -142,7 +142,7 @@
virtual void Update(const DataSet *newDataSet);
virtual void EnqueueRayBuffer(cl::CommandQueue &oclQueue, const u_int kernelIndex,
cl::Buffer &rBuff, cl::Buffer &hBuff, const u_int rayCount,
- const VECTOR_CLASS<cl::Event> *events, cl::Event *event);
+ const cl::vector<cl::Event> *events, cl::Event *event);
virtual u_int SetIntersectionKernelArgs(cl::Kernel &kernel, const u_int argIndex);
@@ -229,7 +229,7 @@
void OpenCLMQBVHKernels::EnqueueRayBuffer(cl::CommandQueue &oclQueue, const u_int kernelIndex,
cl::Buffer &rBuff, cl::Buffer &hBuff, const u_int rayCount,
- const VECTOR_CLASS<cl::Event> *events, cl::Event *event) {
+ const cl::vector<cl::Event> *events, cl::Event *event) {
kernels[kernelIndex]->setArg(0, rBuff);
kernels[kernelIndex]->setArg(1, hBuff);
kernels[kernelIndex]->setArg(2, rayCount);
diff -urN luxrender-luxrays-8577ff287efb/src/luxrays/accelerators/qbvhaccel.cpp luxrender-luxrays-clhpp/src/luxrays/accelerators/qbvhaccel.cpp
--- luxrender-luxrays-8577ff287efb/src/luxrays/accelerators/qbvhaccel.cpp 2015-10-06 17:56:47.000000000 +0900
+++ luxrender-luxrays-clhpp/src/luxrays/accelerators/qbvhaccel.cpp 2022-11-11 22:26:33.982184511 +0900
@@ -78,14 +78,14 @@
luxrays::ocl::KernelSource_bbox_types +
luxrays::ocl::KernelSource_qbvh_types +
luxrays::ocl::KernelSource_qbvh);
- cl::Program::Sources source(1, std::make_pair(code.c_str(), code.length()));
+ cl::Program::Sources source(1, code);
cl::Program program = cl::Program(oclContext, source);
try {
- VECTOR_CLASS<cl::Device> buildDevice;
+ cl::vector<cl::Device> buildDevice;
buildDevice.push_back(oclDevice);
program.build(buildDevice, opts.str().c_str());
} catch (cl::Error err) {
- cl::STRING_CLASS strError = program.getBuildInfo<CL_PROGRAM_BUILD_LOG>(oclDevice);
+ cl::string strError = program.getBuildInfo<CL_PROGRAM_BUILD_LOG>(oclDevice);
LR_LOG(deviceContext, "[OpenCL device::" << deviceName <<
"] QBVH compilation error:\n" << strError.c_str());
@@ -125,7 +125,7 @@
virtual void Update(const DataSet *newDataSet) { assert(false); }
virtual void EnqueueRayBuffer(cl::CommandQueue &oclQueue, const u_int kernelIndex,
cl::Buffer &rBuff, cl::Buffer &hBuff, const u_int rayCount,
- const VECTOR_CLASS<cl::Event> *events, cl::Event *event);
+ const cl::vector<cl::Event> *events, cl::Event *event);
virtual u_int SetIntersectionKernelArgs(cl::Kernel &kernel, const u_int argIndex);
@@ -146,7 +146,7 @@
void OpenCLQBVHKernels::EnqueueRayBuffer(cl::CommandQueue &oclQueue, const u_int kernelIndex,
cl::Buffer &rBuff, cl::Buffer &hBuff, const u_int rayCount,
- const VECTOR_CLASS<cl::Event> *events, cl::Event *event) {
+ const cl::vector<cl::Event> *events, cl::Event *event) {
kernels[kernelIndex]->setArg(0, rBuff);
kernels[kernelIndex]->setArg(1, hBuff);
kernels[kernelIndex]->setArg(2, rayCount);
@@ -225,14 +225,14 @@
luxrays::ocl::KernelSource_bbox_types +
luxrays::ocl::KernelSource_qbvh_types +
luxrays::ocl::KernelSource_qbvh);
- cl::Program::Sources source(1, std::make_pair(code.c_str(), code.length()));
+ cl::Program::Sources source(1, code);
cl::Program program = cl::Program(oclContext, source);
try {
- VECTOR_CLASS<cl::Device> buildDevice;
+ cl::vector<cl::Device> buildDevice;
buildDevice.push_back(oclDevice);
program.build(buildDevice, opts.str().c_str());
} catch (cl::Error err) {
- cl::STRING_CLASS strError = program.getBuildInfo<CL_PROGRAM_BUILD_LOG>(oclDevice);
+ cl::string strError = program.getBuildInfo<CL_PROGRAM_BUILD_LOG>(oclDevice);
LR_LOG(deviceContext, "[OpenCL device::" << deviceName <<
"] QBVH Image Storage compilation error:\n" <<
strError.c_str());
@@ -273,7 +273,7 @@
virtual void Update(const DataSet *newDataSet) { assert(false); }
virtual void EnqueueRayBuffer(cl::CommandQueue &oclQueue, const u_int kernelIndex,
cl::Buffer &rBuff, cl::Buffer &hBuff, const u_int rayCount,
- const VECTOR_CLASS<cl::Event> *events, cl::Event *event);
+ const cl::vector<cl::Event> *events, cl::Event *event);
virtual u_int SetIntersectionKernelArgs(cl::Kernel &kernel, const u_int argIndex);
@@ -294,7 +294,7 @@
void OpenCLQBVHImageKernels::EnqueueRayBuffer(cl::CommandQueue &oclQueue, const u_int kernelIndex,
cl::Buffer &rBuff, cl::Buffer &hBuff, const u_int rayCount,
- const VECTOR_CLASS<cl::Event> *events, cl::Event *event) {
+ const cl::vector<cl::Event> *events, cl::Event *event) {
kernels[kernelIndex]->setArg(0, rBuff);
kernels[kernelIndex]->setArg(1, hBuff);
kernels[kernelIndex]->setArg(2, rayCount);
diff -urN luxrender-luxrays-8577ff287efb/src/luxrays/core/context.cpp luxrender-luxrays-clhpp/src/luxrays/core/context.cpp
--- luxrender-luxrays-8577ff287efb/src/luxrays/core/context.cpp 2022-11-11 21:26:31.811907177 +0900
+++ luxrender-luxrays-clhpp/src/luxrays/core/context.cpp 2022-11-11 21:38:07.353061785 +0900
@@ -42,7 +42,7 @@
#if !defined(LUXRAYS_DISABLE_OPENCL)
// Platform info
- VECTOR_CLASS<cl::Platform> platforms;
+ cl::vector<cl::Platform> platforms;
try {
cl::Platform::get(&platforms);
@@ -219,4 +219,4 @@
idevices.push_back(virtualDevice);
return realDevices;
-}
\ ファイル末尾に改行がありません
+}
diff -urN luxrender-luxrays-8577ff287efb/src/luxrays/core/device.cpp luxrender-luxrays-clhpp/src/luxrays/core/device.cpp
--- luxrender-luxrays-8577ff287efb/src/luxrays/core/device.cpp 2022-11-11 21:26:31.811907177 +0900
+++ luxrender-luxrays-clhpp/src/luxrays/core/device.cpp 2022-11-11 22:57:07.437275874 +0900
@@ -17,6 +17,8 @@
***************************************************************************/
#if !defined(LUXRAYS_DISABLE_OPENCL) && !defined(WIN32) && !defined(__APPLE__)
+#define CL_HPP_ENABLE_EXCEPTIONS
+#include <CL/opencl.hpp>
#include <GL/glx.h>
#endif
@@ -174,7 +176,7 @@
const DeviceType filter, std::vector<DeviceDescription *> &descriptions)
{
// Get the list of devices available on the platform
- VECTOR_CLASS<cl::Device> oclDevices;
+ cl::vector<cl::Device> oclDevices;
try {
oclPlatform.getDevices(CL_DEVICE_TYPE_ALL, &oclDevices);
@@ -202,9 +204,9 @@
cl::Context &OpenCLDeviceDescription::GetOCLContext() const {
if (!oclContext) {
// Allocate a context with the selected device
- VECTOR_CLASS<cl::Device> devices;
+ cl::vector<cl::Device> devices;
devices.push_back(oclDevice);
- cl::Platform platform = oclDevice.getInfo<CL_DEVICE_PLATFORM>();
+ cl::Platform platform (oclDevice.getInfo<CL_DEVICE_PLATFORM>());
if (enableOpenGLInterop) {
#if defined (__APPLE__)
diff -urN luxrender-luxrays-8577ff287efb/src/luxrays/utils/ocl.cpp luxrender-luxrays-clhpp/src/luxrays/utils/ocl.cpp
--- luxrender-luxrays-8577ff287efb/src/luxrays/utils/ocl.cpp 2022-11-11 21:26:31.811907177 +0900
+++ luxrender-luxrays-clhpp/src/luxrays/utils/ocl.cpp 2022-11-11 21:45:12.718870455 +0900
@@ -149,14 +149,14 @@
cl::Program *oclKernelCache::ForcedCompile(cl::Context &context, cl::Device &device,
const std::string &kernelsParameters, const std::string &kernelSource,
- cl::STRING_CLASS *error) {
+ cl::string *error) {
cl::Program *program = NULL;
try {
- cl::Program::Sources source(1, std::make_pair(kernelSource.c_str(), kernelSource.length()));
+ cl::Program::Sources source(1, cl::Program::Sources::value_type(kernelSource.c_str(), kernelSource.length()));
program = new cl::Program(context, source);
- VECTOR_CLASS<cl::Device> buildDevice;
+ cl::vector<cl::Device> buildDevice;
buildDevice.push_back(device);
program->build(buildDevice, kernelsParameters.c_str());
} catch (cl::Error err) {
@@ -190,7 +190,7 @@
cl::Program *oclKernelVolatileCache::Compile(cl::Context &context, cl::Device& device,
const std::string &kernelsParameters, const std::string &kernelSource,
- bool *cached, cl::STRING_CLASS *error) {
+ bool *cached, cl::string *error) {
// Check if the kernel is available in the cache
boost::unordered_map<std::string, cl::Program::Binaries>::iterator it = kernelCache.find(kernelsParameters);
@@ -202,18 +202,18 @@
return NULL;
// Obtain the binaries of the sources
- VECTOR_CLASS<char *> bins = program->getInfo<CL_PROGRAM_BINARIES>();
+ auto bins = program->getInfo<CL_PROGRAM_BINARIES>();
assert (bins.size() == 1);
- VECTOR_CLASS<size_t> sizes = program->getInfo<CL_PROGRAM_BINARY_SIZES>();
+ cl::vector<size_t> sizes = program->getInfo<CL_PROGRAM_BINARY_SIZES>();
assert (sizes.size() == 1);
- if (sizes[0] > 0) {
+ if (bins[0].size() > 0) {
// Add the kernel to the cache
- char *bin = new char[sizes[0]];
- memcpy(bin, bins[0], sizes[0]);
+ char *bin = new char[bins[0].size()];
+ memcpy(bin, bins[0].data(), bins[0].size());
kernels.push_back(bin);
- kernelCache[kernelsParameters] = cl::Program::Binaries(1, std::make_pair(bin, sizes[0]));
+ kernelCache[kernelsParameters] = cl::Program::Binaries(1, cl::Program::Binaries::value_type(bin, bin + bins[0].size()));
}
if (cached)
@@ -222,7 +222,7 @@
return program;
} else {
// Compile from the binaries
- VECTOR_CLASS<cl::Device> buildDevice;
+ cl::vector<cl::Device> buildDevice;
buildDevice.push_back(device);
cl::Program *program = new cl::Program(context, buildDevice, it->second);
program->build(buildDevice);
@@ -288,10 +288,10 @@
cl::Program *oclKernelPersistentCache::Compile(cl::Context &context, cl::Device& device,
const std::string &kernelsParameters, const std::string &kernelSource,
- bool *cached, cl::STRING_CLASS *error) {
+ bool *cached, cl::string *error) {
// Check if the kernel is available in the cache
- const cl::Platform platform = device.getInfo<CL_DEVICE_PLATFORM>();
+ const cl::Platform platform(device.getInfo<CL_DEVICE_PLATFORM>());
const std::string platformName = boost::trim_copy(platform.getInfo<CL_PLATFORM_VENDOR>());
const std::string deviceName = boost::trim_copy(device.getInfo<CL_DEVICE_NAME>());
const std::string deviceUnits = ToString(device.getInfo<CL_DEVICE_MAX_COMPUTE_UNITS>());
@@ -310,22 +310,22 @@
return NULL;
// Obtain the binaries of the sources
- VECTOR_CLASS<char *> bins = program->getInfo<CL_PROGRAM_BINARIES>();
+ auto bins = program->getInfo<CL_PROGRAM_BINARIES>();
assert (bins.size() == 1);
- VECTOR_CLASS<size_t> sizes = program->getInfo<CL_PROGRAM_BINARY_SIZES>();
+ cl::vector<size_t> sizes = program->getInfo<CL_PROGRAM_BINARY_SIZES>();
assert (sizes.size() == 1);
// Create the file only if the binaries include something
- if (sizes[0] > 0) {
+ if (bins[0].size() > 0) {
// Add the kernel to the cache
boost::filesystem::create_directories(dirPath);
BOOST_OFSTREAM file(fileName.c_str(), std::ios_base::out | std::ios_base::binary);
// Write the binary hash
- const u_int hashBin = HashBin(bins[0], sizes[0]);
+ const u_int hashBin = HashBin((char*)(bins[0].data()), bins[0].size());
file.write((char *)&hashBin, sizeof(int));
- file.write(bins[0], sizes[0]);
+ file.write((char*)(bins[0].data()), bins[0].size());
// Check for errors
char buf[512];
if (file.fail()) {
@@ -371,10 +371,10 @@
return Compile(context, device, kernelsParameters, kernelSource, cached, error);
} else {
// Compile from the binaries
- VECTOR_CLASS<cl::Device> buildDevice;
+ cl::vector<cl::Device> buildDevice;
buildDevice.push_back(device);
cl::Program *program = new cl::Program(context, buildDevice,
- cl::Program::Binaries(1, std::make_pair(kernelBin, kernelSize)));
+ cl::Program::Binaries(1, cl::Program::Binaries::value_type(kernelBin, kernelBin + kernelSize)));
program->build(buildDevice);
if (cached)
diff -urN luxrender-luxrays-8577ff287efb/src/slg/engines/pathoclbase/pathoclbasethread.cpp luxrender-luxrays-clhpp/src/slg/engines/pathoclbase/pathoclbasethread.cpp
--- luxrender-luxrays-8577ff287efb/src/slg/engines/pathoclbase/pathoclbasethread.cpp 2022-11-11 21:26:31.815240454 +0900
+++ luxrender-luxrays-clhpp/src/slg/engines/pathoclbase/pathoclbasethread.cpp 2022-11-11 21:33:02.095133503 +0900
@@ -1342,7 +1342,7 @@
}
bool cached;
- cl::STRING_CLASS error;
+ cl::string error;
cl::Program *program = kernelCache->Compile(oclContext, oclDevice,
kernelsParameters, kernelSource,
&cached, &error);