OpenCL backend wrapper for cl::Program object
| 18 | |
| 19 | /// OpenCL backend wrapper for cl::Program object |
| 20 | class Module : public common::ModuleInterface<cl::Program> { |
| 21 | public: |
| 22 | using ModuleType = cl::Program; |
| 23 | using BaseClass = common::ModuleInterface<ModuleType>; |
| 24 | |
| 25 | /// \brief Create an uninitialized Module |
| 26 | Module() = default; |
| 27 | |
| 28 | /// \brief Create a module given a cl::Program type |
| 29 | Module(ModuleType mod) : BaseClass(mod) {} |
| 30 | |
| 31 | /// \brief Unload module |
| 32 | operator bool() const final { return get()(); } |
| 33 | |
| 34 | /// Unload the module |
| 35 | void unload() final { set(cl::Program()); } |
| 36 | }; |
| 37 | |
| 38 | } // namespace opencl |
| 39 | } // namespace arrayfire |