10 #include "hc_defines.h" 11 #include "kalmar_runtime.h" 12 #include "kalmar_serialize.h" 17 #if __KALMAR_ACCELERATOR__ == 2 || __KALMAR_CPU__ == 2 18 static const unsigned int NTHREAD = std::thread::hardware_concurrency();
20 template <
typename Kernel>
23 const std::shared_ptr<Kalmar::KalmarQueue> pQueue;
25 std::vector<std::thread> th;
27 CPUKernelRAII(
const std::shared_ptr<Kalmar::KalmarQueue> pQueue,
const Kernel& f)
28 : pQueue(pQueue), f(f), th(NTHREAD) {
29 CPUVisitor vis(pQueue);
31 f.__cxxamp_serialize(s);
32 CLAMP::enter_kernel();
34 std::thread& operator[](
int i) {
return th[i]; }
39 CPUVisitor vis(pQueue);
41 f.__cxxamp_serialize(ss);
42 CLAMP::leave_kernel();
namespace for internal classes of Kalmar compiler / runtime
Definition: hc.hpp:42
Definition: kalmar_cpu_launch.h:15