69 void * dst,
void const * src,
size_t buffer_size,
90static void *xt_acc_malloc(
97 "ERROR(xt_cuda_malloc): unsupported memory type",
103 return acc_malloc(alloc_size + (alloc_size == 0));
107static void xt_acc_free(
void *ptr,
enum xt_memtype memtype) {
113 "ERROR(xt_cuda_free): unsupported memory type",
140#define CHECK_FOR_HOST_MEM(type) \
142 if (type != XT_MEMTYPE_HOST) { \
145 "ERROR(" STR(__func__) "): unsupported memory type", \
146 filename, __LINE__); \
165 void * dst,
void const * src,
size_t buffer_size,
171 memcpy(dst, src, buffer_size);
192 void * dst,
void const * src,
size_t buffer_size,
194 vtable.
Memcpy(dst, src, buffer_size, dst_memtype, src_memtype);
add versions of standard API functions not returning on error
void(* Memcpy)(void *dst, void const *src, size_t buffer_size, enum xt_memtype dst_memtype, enum xt_memtype src_memtype)
void(* Free)(void *ptr, enum xt_memtype memtype)
enum xt_memtype(* Get_memtype)(const void *ptr)
int(* Instr_push)(char const *name)
void *(* Malloc)(size_t alloc_size, enum xt_memtype memtype)
const struct xt_gpu_vtable * xt_cuda_init(void)
static struct xt_gpu_vtable const cuda_vtable
routines for using CUDA in yaxt
static const char filename[]
int xt_gpu_instr_pop(void)
static enum xt_memtype default_get_memtype(const void *ptr)
int xt_gpu_instr_push(char const *name)
static void * default_malloc(size_t alloc_size, enum xt_memtype memtype)
static void default_memcpy(void *dst, void const *src, size_t buffer_size, enum xt_memtype dst_memtype, enum xt_memtype src_memtype)
static struct xt_gpu_vtable vtable
void * xt_gpu_malloc(size_t alloc_size, enum xt_memtype memtype)
enum xt_memtype xt_gpu_get_memtype(const void *ptr)
static int default_instr_push(char const *)
void xt_gpu_memcpy(void *dst, void const *src, size_t buffer_size, enum xt_memtype dst_memtype, enum xt_memtype src_memtype)
#define CHECK_FOR_HOST_MEM(type)
static void default_free(void *ptr, enum xt_memtype memtype)
static int default_instr_pop(void)
void xt_gpu_free(void *ptr, enum xt_memtype memtype)
routines for using GPU devices