Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/rng/backends/mklcpu/cpu_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,20 @@ namespace mklcpu {
// host_task automatically uses run_on_host_intel if it is supported by the
// compiler. Otherwise, it falls back to single_task.
template <typename K, typename H, typename F>
static inline auto host_task_internal(H& cgh, F f, int) -> decltype(cgh.host_task(f)) {
return cgh.host_task(f);
static inline auto host_task_internal(H& cgh, F&& f, int) {
return cgh.host_task(std::forward<F>(f));
}

template <typename K, typename H, typename F>
static inline void host_task_internal(H& cgh, F f, long) {
static inline void host_task_internal(H& cgh, F&& f, long) {
#ifndef __SYCL_DEVICE_ONLY__
cgh.template single_task<K>(f);
cgh.template single_task<K>(std::forward<F>(f));
#endif
}

template <typename K, typename H, typename F>
static inline void host_task(H& cgh, F f) {
(void)host_task_internal<K>(cgh, f, 0);
static inline void host_task(H& cgh, F&& f) {
(void)host_task_internal<K>(cgh, std::forward<F>(f), 0);
}

template <typename Engine, typename Distr>
Expand Down
Loading