54#include <hip/hip_runtime.h>
61 unsigned char v,
size_t n)
65 for (
size_t i = idx;
i < n;
i +=
str)
74 const unsigned long long
79 for (
size_t i = idx;
i < n;
i +=
str)
89 for (
size_t i = idx;
i < n;
i +=
str)
126 const char *
env =
getenv(
"NEKO_HIP_ZEROCOPY");
144 "Neko: warning: NEKO_HIP_ZEROCOPY=1 requested but this "
145 "device does not support zero-copy mapping (needs a "
146 "unified-memory APU with XNACK); using replicated "
177 "Neko: warning: coarse-grain advise of zero-copy mapping "
178 "failed; mapped arrays stay fine-grained (slower kernels)\n");
212#if HIP_VERSION_MAJOR >= 6
246 const size_t nb = (s + 1024 - 1) / 1024;
249 (
nb == 0 ? 1 :
nb)), 1, 1);
252 (
unsigned char *)
ptr_d, (
unsigned char)
value, s);
270 int kind,
void *stream)
276 const size_t n = s / 8;
277 const size_t nb = (n + 1024 - 1) / 1024;
279 const dim3 nblcks((
unsigned int) (
nb > 65535 ? 65535 :
nb), 1, 1);
282 (
unsigned long long *)
dst,
283 (
const unsigned long long *)
src, n);
286 const size_t nb = (s + 1024 - 1) / 1024;
288 const dim3 nblcks((
unsigned int) (
nb > 65535 ? 65535 :
nb), 1, 1);
291 (
unsigned char *)
dst,
292 (
const unsigned char *)
src, s);
__global__ void ale_add_kinematics_kernel(const int n, T *__restrict__ wx, T *__restrict__ wy, T *__restrict__ wz, const T *__restrict__ x_ref, const T *__restrict__ y_ref, const T *__restrict__ z_ref, const T *__restrict__ phi, const T *__restrict__ x, const T *__restrict__ y, const T *__restrict__ z, const kinematics_params_t kin_params)
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ const T *__restrict__ v
__global__ void hip_unified_copy8_kernel(unsigned long long *__restrict__ a, const unsigned long long *__restrict__ b, size_t n)
__global__ void hip_unified_copy1_kernel(unsigned char *__restrict__ a, const unsigned char *__restrict__ b, size_t n)
hipError_t hip_map(void **ptr_d, void *ptr_h, size_t s)
static int hip_is_device_alloc(void *ptr_d)
hipError_t hip_map_memset(void *ptr_d, int value, size_t s, void *stream)
hipError_t hip_map_free(void *ptr_d)
__global__ void hip_unified_memset_kernel(unsigned char *a, unsigned char v, size_t n)
hipError_t hip_map_memcpy(void *dst, void *src, size_t s, int kind, void *stream)