ddemidov / vexcl

VexCL is a C++ vector expression template library for OpenCL/CUDA/OpenMP
http://vexcl.readthedocs.org
MIT License
702 stars 82 forks source link

error: ‘Type’ is not a member of ‘vex::Filter’ when VEXCL_BACKEND_CUDA is defined #235

Open mw66 opened 6 years ago

mw66 commented 6 years ago

ctx = new vex::Context( vex::Filter::Type(CL_DEVICE_TYPE_GPU) && vex::Filter::DoublePrecision && vex::Filter::Count(1) );

I think vex should define a dummy func in this case, so the client code no matter which backend it choose to use.

ddemidov commented 6 years ago

CL_DEVICE_TYPE_* constants are defined in CL/cl.h, which may be unavailable for non-opencl-based backends. How about providing using dummy vex::Filter::GPU, vex::Filter::CPU, vex::Filter::Accelerator instead?

EDIT: those are already defined for the CUDA backend: https://github.com/ddemidov/vexcl/blob/master/vexcl/backend/cuda/filter.hpp#L53-L56