Driver: Fixed issue in ownership handling for BLAS
This commit is contained in:
@@ -19,7 +19,7 @@ class ISAACAPI Buffer
|
|||||||
friend class CommandQueue;
|
friend class CommandQueue;
|
||||||
friend class Kernel;
|
friend class Kernel;
|
||||||
public:
|
public:
|
||||||
Buffer(cl_mem Buffer);
|
Buffer(cl_mem Buffer, bool take_ownership = true);
|
||||||
Buffer(Context const & context, std::size_t size);
|
Buffer(Context const & context, std::size_t size);
|
||||||
Context const & context() const;
|
Context const & context() const;
|
||||||
bool operator<(Buffer const &) const;
|
bool operator<(Buffer const &) const;
|
||||||
|
@@ -23,7 +23,7 @@ class Buffer;
|
|||||||
class ISAACAPI CommandQueue
|
class ISAACAPI CommandQueue
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CommandQueue(cl_command_queue const & queue);
|
CommandQueue(cl_command_queue const & queue, bool take_ownership = true);
|
||||||
CommandQueue(Context const & context, Device const & device, cl_command_queue_properties properties = 0);
|
CommandQueue(Context const & context, Device const & device, cl_command_queue_properties properties = 0);
|
||||||
Context const & context() const;
|
Context const & context() const;
|
||||||
Device const & device() const;
|
Device const & device() const;
|
||||||
|
@@ -21,7 +21,7 @@ class ISAACAPI Context
|
|||||||
friend class Buffer;
|
friend class Buffer;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit Context(cl_context const & context);
|
explicit Context(cl_context const & context, bool take_ownership = true);
|
||||||
explicit Context(Device const & device);
|
explicit Context(Device const & device);
|
||||||
backend_type backend() const;
|
backend_type backend() const;
|
||||||
Device const & device() const;
|
Device const & device() const;
|
||||||
|
@@ -37,7 +37,7 @@ public:
|
|||||||
#ifdef ISAAC_WITH_CUDA
|
#ifdef ISAAC_WITH_CUDA
|
||||||
Device(int ordinal);
|
Device(int ordinal);
|
||||||
#endif
|
#endif
|
||||||
Device(cl_device_id const & device);
|
Device(cl_device_id const & device, bool take_ownership = true);
|
||||||
backend_type backend() const;
|
backend_type backend() const;
|
||||||
size_t clock_rate() const;
|
size_t clock_rate() const;
|
||||||
unsigned int address_bits() const;
|
unsigned int address_bits() const;
|
||||||
|
@@ -16,7 +16,7 @@ class ISAACAPI Event
|
|||||||
{
|
{
|
||||||
friend class CommandQueue;
|
friend class CommandQueue;
|
||||||
public:
|
public:
|
||||||
Event(cl_event const & event);
|
Event(cl_event const & event, bool take_ownership = true);
|
||||||
Event(backend_type backend);
|
Event(backend_type backend);
|
||||||
long elapsed_time() const;
|
long elapsed_time() const;
|
||||||
HANDLE_TYPE(cl_event, cu_event_t)& handle();
|
HANDLE_TYPE(cl_event, cu_event_t)& handle();
|
||||||
|
@@ -43,9 +43,10 @@ private:
|
|||||||
static void release(cl_program x);
|
static void release(cl_program x);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Handle(backend_type backend);
|
Handle(backend_type backend, bool take_ownership = true);
|
||||||
bool operator==(Handle const & other) const;
|
bool operator==(Handle const & other) const;
|
||||||
bool operator<(Handle const & other) const;
|
bool operator<(Handle const & other) const;
|
||||||
|
bool has_ownership() const;
|
||||||
CLType & cl();
|
CLType & cl();
|
||||||
CLType const & cl() const;
|
CLType const & cl() const;
|
||||||
#ifdef ISAAC_WITH_CUDA
|
#ifdef ISAAC_WITH_CUDA
|
||||||
@@ -58,6 +59,7 @@ private:
|
|||||||
std::shared_ptr<CUType> cu_;
|
std::shared_ptr<CUType> cu_;
|
||||||
private:
|
private:
|
||||||
backend_type backend_;
|
backend_type backend_;
|
||||||
|
bool has_ownership_;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -338,6 +338,7 @@ void dot::enqueue(driver::CommandQueue & queue, driver::Program & program, const
|
|||||||
kernel.setArg(n_arg++, tmp_[i]);
|
kernel.setArg(n_arg++, tmp_[i]);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
set_arguments(expressions, kernel, n_arg);
|
set_arguments(expressions, kernel, n_arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -8,12 +8,12 @@ namespace isaac
|
|||||||
namespace driver
|
namespace driver
|
||||||
{
|
{
|
||||||
|
|
||||||
Buffer::Buffer(cl_mem buffer) : backend_(OPENCL), context_(ocl::info<CL_MEM_CONTEXT>(buffer)), h_(backend_)
|
Buffer::Buffer(cl_mem buffer, bool take_ownership) : backend_(OPENCL), context_(ocl::info<CL_MEM_CONTEXT>(buffer), take_ownership), h_(backend_, take_ownership)
|
||||||
{
|
{
|
||||||
h_.cl() = buffer;
|
h_.cl() = buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
Buffer::Buffer(Context const & context, std::size_t size) : backend_(context.backend_), context_(context), h_(backend_)
|
Buffer::Buffer(Context const & context, std::size_t size) : backend_(context.backend_), context_(context), h_(backend_, context.h_.has_ownership())
|
||||||
|
|
||||||
{
|
{
|
||||||
switch(backend_)
|
switch(backend_)
|
||||||
|
@@ -17,12 +17,12 @@ namespace isaac
|
|||||||
namespace driver
|
namespace driver
|
||||||
{
|
{
|
||||||
|
|
||||||
CommandQueue::CommandQueue(cl_command_queue const & queue) : backend_(OPENCL), context_(ocl::info<CL_QUEUE_CONTEXT>(queue)), device_(ocl::info<CL_QUEUE_DEVICE>(queue)), h_(backend_)
|
CommandQueue::CommandQueue(cl_command_queue const & queue, bool take_ownership) : backend_(OPENCL), context_(ocl::info<CL_QUEUE_CONTEXT>(queue), take_ownership), device_(ocl::info<CL_QUEUE_DEVICE>(queue), take_ownership), h_(backend_, take_ownership)
|
||||||
{
|
{
|
||||||
h_.cl() = queue;
|
h_.cl() = queue;
|
||||||
}
|
}
|
||||||
|
|
||||||
CommandQueue::CommandQueue(Context const & context, Device const & device, cl_command_queue_properties properties): backend_(device.backend_), context_(context), device_(device), h_(backend_)
|
CommandQueue::CommandQueue(Context const & context, Device const & device, cl_command_queue_properties properties): backend_(device.backend_), context_(context), device_(device), h_(backend_, context.h_.has_ownership())
|
||||||
{
|
{
|
||||||
switch(backend_)
|
switch(backend_)
|
||||||
{
|
{
|
||||||
|
@@ -8,12 +8,12 @@ namespace isaac
|
|||||||
namespace driver
|
namespace driver
|
||||||
{
|
{
|
||||||
|
|
||||||
Context::Context(cl_context const & context) : backend_(OPENCL), device_(ocl::info<CL_CONTEXT_DEVICES>(context)[0]), h_(backend_)
|
Context::Context(cl_context const & context, bool take_ownership) : backend_(OPENCL), device_(ocl::info<CL_CONTEXT_DEVICES>(context)[0], take_ownership), h_(backend_, take_ownership)
|
||||||
{
|
{
|
||||||
h_.cl() = context;
|
h_.cl() = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
Context::Context(Device const & device) : backend_(device.backend_), device_(device), h_(backend_)
|
Context::Context(Device const & device) : backend_(device.backend_), device_(device), h_(backend_, device.h_.has_ownership())
|
||||||
{
|
{
|
||||||
#ifndef ANDROID
|
#ifndef ANDROID
|
||||||
if (std::getenv("ISAAC_CACHE_PATH"))
|
if (std::getenv("ISAAC_CACHE_PATH"))
|
||||||
|
@@ -18,13 +18,13 @@ int Device::cuGetInfo() const
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
Device::Device(int ordinal): backend_(CUDA), h_(backend_)
|
Device::Device(int ordinal, bool take_ownership): backend_(CUDA), h_(backend_, take_ownership)
|
||||||
{ cuda::check(cuDeviceGet(h_.cu.get(), ordinal)); }
|
{ cuda::check(cuDeviceGet(h_.cu.get(), ordinal)); }
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
Device::Device(cl_device_id const & device) : backend_(OPENCL), h_(backend_)
|
Device::Device(cl_device_id const & device, bool take_ownership) : backend_(OPENCL), h_(backend_, take_ownership)
|
||||||
{ h_.cl() = device; }
|
{ h_.cl() = device; }
|
||||||
|
|
||||||
backend_type Device::backend() const
|
backend_type Device::backend() const
|
||||||
|
@@ -7,7 +7,7 @@ namespace isaac
|
|||||||
namespace driver
|
namespace driver
|
||||||
{
|
{
|
||||||
|
|
||||||
Event::Event(backend_type backend) : backend_(backend), h_(backend_)
|
Event::Event(backend_type backend) : backend_(backend), h_(backend_, true)
|
||||||
{
|
{
|
||||||
switch(backend_)
|
switch(backend_)
|
||||||
{
|
{
|
||||||
@@ -22,7 +22,7 @@ Event::Event(backend_type backend) : backend_(backend), h_(backend_)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Event::Event(cl_event const & event) : backend_(OPENCL), h_(backend_)
|
Event::Event(cl_event const & event, bool take_ownership) : backend_(OPENCL), h_(backend_, take_ownership)
|
||||||
{
|
{
|
||||||
h_.cl() = event;
|
h_.cl() = event;
|
||||||
}
|
}
|
||||||
|
@@ -57,7 +57,7 @@ template<class CLType, class CUType>
|
|||||||
void Handle<CLType, CUType>::release(cl_program x) { ocl::check(clReleaseProgram(x)); }
|
void Handle<CLType, CUType>::release(cl_program x) { ocl::check(clReleaseProgram(x)); }
|
||||||
|
|
||||||
template<class CLType, class CUType>
|
template<class CLType, class CUType>
|
||||||
Handle<CLType, CUType>::Handle(backend_type backend): backend_(backend)
|
Handle<CLType, CUType>::Handle(backend_type backend, bool take_ownership): backend_(backend), has_ownership_(take_ownership)
|
||||||
{
|
{
|
||||||
switch(backend_)
|
switch(backend_)
|
||||||
{
|
{
|
||||||
@@ -100,10 +100,10 @@ template<class CLType, class CUType>
|
|||||||
Handle<CLType, CUType>::~Handle()
|
Handle<CLType, CUType>::~Handle()
|
||||||
{
|
{
|
||||||
#ifdef ISAAC_WITH_CUDA
|
#ifdef ISAAC_WITH_CUDA
|
||||||
if(cu_ && cu_.unique())
|
if(has_ownership_ && cu_ && cu_.unique())
|
||||||
_delete(*cu_);
|
_delete(*cu_);
|
||||||
#endif
|
#endif
|
||||||
if(cl_ && cl_.unique())
|
if(has_ownership_ && cl_ && cl_.unique())
|
||||||
release(*cl_);
|
release(*cl_);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,6 +115,10 @@ template<class CLType, class CUType>
|
|||||||
CLType const & Handle<CLType, CUType>::cl() const
|
CLType const & Handle<CLType, CUType>::cl() const
|
||||||
{ return *cl_; }
|
{ return *cl_; }
|
||||||
|
|
||||||
|
template<class CLType, class CUType>
|
||||||
|
bool Handle<CLType,CUType>::has_ownership() const
|
||||||
|
{ return has_ownership_; }
|
||||||
|
|
||||||
#ifdef ISAAC_WITH_CUDA
|
#ifdef ISAAC_WITH_CUDA
|
||||||
template<class CLType, class CUType>
|
template<class CLType, class CUType>
|
||||||
CUType & Handle<CLType, CUType>::cu()
|
CUType & Handle<CLType, CUType>::cu()
|
||||||
|
@@ -8,7 +8,7 @@ namespace isaac
|
|||||||
namespace driver
|
namespace driver
|
||||||
{
|
{
|
||||||
|
|
||||||
Kernel::Kernel(Program const & program, const char * name) : backend_(program.backend_), address_bits_(program.context().device().address_bits()), h_(backend_)
|
Kernel::Kernel(Program const & program, const char * name) : backend_(program.backend_), address_bits_(program.context().device().address_bits()), h_(backend_, program.h_.has_ownership())
|
||||||
{
|
{
|
||||||
switch(backend_)
|
switch(backend_)
|
||||||
{
|
{
|
||||||
|
@@ -11,7 +11,7 @@ namespace driver
|
|||||||
{
|
{
|
||||||
|
|
||||||
#ifdef ISAAC_WITH_CUDA
|
#ifdef ISAAC_WITH_CUDA
|
||||||
Platform::Platform(backend_type backend): backend_(backend){}
|
Platform::Platform(backend_type backend): backend_(backend, take_ownership){}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Platform::Platform(cl_platform_id const & platform) : backend_(OPENCL)
|
Platform::Platform(cl_platform_id const & platform) : backend_(OPENCL)
|
||||||
|
@@ -16,7 +16,7 @@ namespace isaac
|
|||||||
namespace driver
|
namespace driver
|
||||||
{
|
{
|
||||||
|
|
||||||
Program::Program(Context const & context, std::string const & source) : backend_(context.backend_), context_(context), source_(source), h_(backend_)
|
Program::Program(Context const & context, std::string const & source) : backend_(context.backend_), context_(context), source_(source), h_(backend_, context.h_.has_ownership())
|
||||||
{
|
{
|
||||||
// std::cout << source << std::endl;
|
// std::cout << source << std::endl;
|
||||||
std::string cache_path = context.cache_path_;
|
std::string cache_path = context.cache_path_;
|
||||||
|
@@ -28,9 +28,7 @@ extern "C"
|
|||||||
for(cl_uint i = 0 ; i < numCommandQueues ; ++i)
|
for(cl_uint i = 0 ; i < numCommandQueues ; ++i)
|
||||||
{
|
{
|
||||||
std::list<is::driver::Event> levents;
|
std::list<is::driver::Event> levents;
|
||||||
is::driver::CommandQueue queue(commandQueues[i]);
|
is::execution_options_type options(is::driver::CommandQueue(commandQueues[i],false), &levents, &waitlist);
|
||||||
clRetainCommandQueue(commandQueues[i]);
|
|
||||||
is::execution_options_type options(queue, &levents, &waitlist);
|
|
||||||
is::execute(is::control(operation, options), is::models(options.queue(context)));
|
is::execute(is::control(operation, options), is::models(options.queue(context)));
|
||||||
if(events)
|
if(events)
|
||||||
{
|
{
|
||||||
@@ -54,10 +52,8 @@ extern "C"
|
|||||||
cl_uint numEventsInWaitList, const cl_event *eventWaitList, \
|
cl_uint numEventsInWaitList, const cl_event *eventWaitList, \
|
||||||
cl_event *events) \
|
cl_event *events) \
|
||||||
{ \
|
{ \
|
||||||
is::array x(N, TYPE_ISAAC, mx, offx, incx); \
|
is::array x(N, TYPE_ISAAC, is::driver::Buffer(mx,false), offx, incx); \
|
||||||
clRetainMemObject(mx); \
|
is::array y(N, TYPE_ISAAC, is::driver::Buffer(my,false), offy, incy); \
|
||||||
is::array y(N, TYPE_ISAAC, my, offy, incy); \
|
|
||||||
clRetainMemObject(my); \
|
|
||||||
execute(is::assign(y, alpha*x + y), y.context(), numCommandQueues, commandQueues, numEventsInWaitList, eventWaitList, events); \
|
execute(is::assign(y, alpha*x + y), y.context(), numCommandQueues, commandQueues, numEventsInWaitList, eventWaitList, events); \
|
||||||
return clblasSuccess; \
|
return clblasSuccess; \
|
||||||
}
|
}
|
||||||
@@ -72,8 +68,7 @@ extern "C"
|
|||||||
cl_uint numCommandQueues, cl_command_queue *commandQueues,\
|
cl_uint numCommandQueues, cl_command_queue *commandQueues,\
|
||||||
cl_uint numEventsInWaitList, const cl_event *eventWaitList, cl_event *events)\
|
cl_uint numEventsInWaitList, const cl_event *eventWaitList, cl_event *events)\
|
||||||
{\
|
{\
|
||||||
is::array x(N, TYPE_ISAAC, mx, offx, incx);\
|
is::array x(N, TYPE_ISAAC, is::driver::Buffer(mx,false), offx, incx);\
|
||||||
clRetainMemObject(mx);\
|
|
||||||
execute(is::assign(x, alpha*x), x.context(), numCommandQueues, commandQueues, numEventsInWaitList, eventWaitList, events);\
|
execute(is::assign(x, alpha*x), x.context(), numCommandQueues, commandQueues, numEventsInWaitList, eventWaitList, events);\
|
||||||
return clblasSuccess;\
|
return clblasSuccess;\
|
||||||
}
|
}
|
||||||
@@ -89,10 +84,8 @@ extern "C"
|
|||||||
cl_uint numCommandQueues, cl_command_queue *commandQueues,\
|
cl_uint numCommandQueues, cl_command_queue *commandQueues,\
|
||||||
cl_uint numEventsInWaitList, const cl_event *eventWaitList, cl_event *events)\
|
cl_uint numEventsInWaitList, const cl_event *eventWaitList, cl_event *events)\
|
||||||
{\
|
{\
|
||||||
const is::array x(N, TYPE_ISAAC, mx, offx, incx);\
|
const is::array x(N, TYPE_ISAAC, is::driver::Buffer(mx, false), offx, incx);\
|
||||||
clRetainMemObject(mx);\
|
is::array y(N, TYPE_ISAAC, is::driver::Buffer(my, false), offy, incy);\
|
||||||
is::array y(N, TYPE_ISAAC, my, offy, incy);\
|
|
||||||
clRetainMemObject(my);\
|
|
||||||
execute(is::assign(y, x), y.context(), numCommandQueues, commandQueues, numEventsInWaitList, eventWaitList, events);\
|
execute(is::assign(y, x), y.context(), numCommandQueues, commandQueues, numEventsInWaitList, eventWaitList, events);\
|
||||||
return clblasSuccess;\
|
return clblasSuccess;\
|
||||||
}
|
}
|
||||||
@@ -109,12 +102,9 @@ extern "C"
|
|||||||
cl_command_queue *commandQueues, cl_uint numEventsInWaitList, \
|
cl_command_queue *commandQueues, cl_uint numEventsInWaitList, \
|
||||||
const cl_event *eventWaitList, cl_event *events) \
|
const cl_event *eventWaitList, cl_event *events) \
|
||||||
{ \
|
{ \
|
||||||
is::array x(N, TYPE_ISAAC, mx, offx, incx); \
|
is::array x(N, TYPE_ISAAC, is::driver::Buffer(mx, false), offx, incx); \
|
||||||
clRetainMemObject(mx); \
|
is::array y(N, TYPE_ISAAC, is::driver::Buffer(my, false), offy, incy); \
|
||||||
is::array y(N, TYPE_ISAAC, my, offy, incy); \
|
is::scalar s(TYPE_ISAAC, is::driver::Buffer(dotProduct, false), offDP); \
|
||||||
clRetainMemObject(my); \
|
|
||||||
is::scalar s(TYPE_ISAAC, dotProduct, offDP); \
|
|
||||||
clRetainMemObject(dotProduct); \
|
|
||||||
execute(is::assign(s, dot(x,y)), s.context(), numCommandQueues, commandQueues, numEventsInWaitList, eventWaitList, events); \
|
execute(is::assign(s, dot(x,y)), s.context(), numCommandQueues, commandQueues, numEventsInWaitList, eventWaitList, events); \
|
||||||
return clblasSuccess; \
|
return clblasSuccess; \
|
||||||
}
|
}
|
||||||
@@ -129,10 +119,8 @@ extern "C"
|
|||||||
cl_mem /*scratchBuff*/, cl_uint numCommandQueues, cl_command_queue *commandQueues,\
|
cl_mem /*scratchBuff*/, cl_uint numCommandQueues, cl_command_queue *commandQueues,\
|
||||||
cl_uint numEventsInWaitList, const cl_event *eventWaitList, cl_event *events)\
|
cl_uint numEventsInWaitList, const cl_event *eventWaitList, cl_event *events)\
|
||||||
{\
|
{\
|
||||||
is::array x(N, TYPE_ISAAC, mx, offx, incx);\
|
is::array x(N, TYPE_ISAAC, is::driver::Buffer(mx, false), offx, incx);\
|
||||||
clRetainMemObject(mx);\
|
is::scalar s(TYPE_ISAAC, is::driver::Buffer(asum, false), offAsum);\
|
||||||
is::scalar s(TYPE_ISAAC, asum, offAsum);\
|
|
||||||
clRetainMemObject(asum);\
|
|
||||||
execute(is::assign(s, sum(abs(x))), s.context(), numCommandQueues, commandQueues, numEventsInWaitList, eventWaitList, events);\
|
execute(is::assign(s, sum(abs(x))), s.context(), numCommandQueues, commandQueues, numEventsInWaitList, eventWaitList, events);\
|
||||||
return clblasSuccess;\
|
return clblasSuccess;\
|
||||||
}
|
}
|
||||||
@@ -156,15 +144,12 @@ extern "C"
|
|||||||
std::swap(M, N);\
|
std::swap(M, N);\
|
||||||
transA = (transA==clblasTrans)?clblasNoTrans:clblasTrans;\
|
transA = (transA==clblasTrans)?clblasNoTrans:clblasTrans;\
|
||||||
}\
|
}\
|
||||||
is::array A(M, N, TYPE_ISAAC, mA, offA, lda);\
|
is::array A(M, N, TYPE_ISAAC, is::driver::Buffer(mA, false), offA, lda);\
|
||||||
clRetainMemObject(mA);\
|
|
||||||
\
|
\
|
||||||
is::int_t sx = N, sy = M;\
|
is::int_t sx = N, sy = M;\
|
||||||
if(transA) std::swap(sx, sy);\
|
if(transA) std::swap(sx, sy);\
|
||||||
is::array x(sx, TYPE_ISAAC, mx, offx, incx);\
|
is::array x(sx, TYPE_ISAAC, is::driver::Buffer(mx, false), offx, incx);\
|
||||||
clRetainMemObject(mx);\
|
is::array y(sy, TYPE_ISAAC, is::driver::Buffer(my, false), offy, incy);\
|
||||||
is::array y(sy, TYPE_ISAAC, my, offy, incy);\
|
|
||||||
clRetainMemObject(my);\
|
|
||||||
\
|
\
|
||||||
is::driver::Context const & context = A.context();\
|
is::driver::Context const & context = A.context();\
|
||||||
if(transA==clblasTrans)\
|
if(transA==clblasTrans)\
|
||||||
@@ -204,12 +189,9 @@ extern "C"
|
|||||||
if(transA==clblasTrans) std::swap(As1, As2);\
|
if(transA==clblasTrans) std::swap(As1, As2);\
|
||||||
if(transB==clblasTrans) std::swap(Bs1, Bs2);\
|
if(transB==clblasTrans) std::swap(Bs1, Bs2);\
|
||||||
/*Struct*/\
|
/*Struct*/\
|
||||||
is::array A(As1, As2, TYPE_ISAAC, mA, offA, lda);\
|
is::array A(As1, As2, TYPE_ISAAC, is::driver::Buffer(mA, false), offA, lda);\
|
||||||
clRetainMemObject(mA);\
|
is::array B(Bs1, Bs2, TYPE_ISAAC, is::driver::Buffer(mB, false), offB, ldb);\
|
||||||
is::array B(Bs1, Bs2, TYPE_ISAAC, mB, offB, ldb);\
|
is::array C(M, N, TYPE_ISAAC, is::driver::Buffer(mC, false), offC, ldc);\
|
||||||
clRetainMemObject(mB);\
|
|
||||||
is::array C(M, N, TYPE_ISAAC, mC, offC, ldc);\
|
|
||||||
clRetainMemObject(mC);\
|
|
||||||
is::driver::Context const & context = C.context();\
|
is::driver::Context const & context = C.context();\
|
||||||
/*Operation*/\
|
/*Operation*/\
|
||||||
if((transA==clblasTrans) && (transB==clblasTrans))\
|
if((transA==clblasTrans) && (transB==clblasTrans))\
|
||||||
|
@@ -45,11 +45,11 @@ void test_reduction(T epsilon, simple_vector_base<T> & cx, simple_vector_base<T
|
|||||||
cout << endl;
|
cout << endl;
|
||||||
|
|
||||||
#define PREFIX "[C]"
|
#define PREFIX "[C]"
|
||||||
// RUN_TEST("DOT", cs+=cx[i]*cy[i], 0, cs, BLAS<T>::F(clblasSdot, clblasDdot)(N, CHANDLE(ds), 0, CHANDLE(x), x.start()[0], x.stride()[0],
|
RUN_TEST("DOT", cs+=cx[i]*cy[i], 0, cs, BLAS<T>::F(clblasSdot, clblasDdot)(N, CHANDLE(ds), 0, CHANDLE(x), x.start()[0], x.stride()[0],
|
||||||
// CHANDLE(y), y.start()[0], y.stride()[0],
|
CHANDLE(y), y.start()[0], y.stride()[0],
|
||||||
// CHANDLE(scratch), 1, &clqueue, 0, NULL, NULL));
|
CHANDLE(scratch), 1, &clqueue, 0, NULL, NULL));
|
||||||
// RUN_TEST("ASUM", cs+=std::fabs(cx[i]), 0, cs, BLAS<T>::F(clblasSasum, clblasDasum)(N, CHANDLE(ds), 0, CHANDLE(x), x.start()[0], x.stride()[0],
|
RUN_TEST("ASUM", cs+=std::fabs(cx[i]), 0, cs, BLAS<T>::F(clblasSasum, clblasDasum)(N, CHANDLE(ds), 0, CHANDLE(x), x.start()[0], x.stride()[0],
|
||||||
// CHANDLE(scratch), 1, &clqueue, 0, NULL, NULL));
|
CHANDLE(scratch), 1, &clqueue, 0, NULL, NULL));
|
||||||
#undef PREFIX
|
#undef PREFIX
|
||||||
#define PREFIX "[C++]"
|
#define PREFIX "[C++]"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user