Skip to content

Support buffer location on CUDA #5827

Open
@sherry-yuan

Description

Cuda support allocation in global memory and cache, the ask is to let cuda usm allocation reserve cache memory when buffer location property of value of 4 is passed in.

change will need to be made here:

pi_result cuda_piextUSMDeviceAlloc(void **result_ptr, pi_context context,
pi_device device,
pi_usm_mem_properties *properties,
size_t size, pi_uint32 alignment) {
assert(result_ptr != nullptr);
assert(context != nullptr);
assert(device != nullptr);
assert(properties == nullptr);
pi_result result = PI_SUCCESS;
try {
ScopedContext active(context);
result = PI_CHECK_ERROR(cuMemAlloc((CUdeviceptr *)result_ptr, size));
} catch (pi_result error) {
result = error;
}
assert(alignment == 0 ||
(result == PI_SUCCESS &&
reinterpret_cast<std::uintptr_t>(*result_ptr) % alignment == 0));
return result;
}

enum class target {
  device,
  host_task,
  global_buffer = device, // Deprecated
  constant_buffer, // Deprecated
  local, // Deprecated
  host_buffer // Deprecated
};

Metadata

Assignees

No one assigned

    Labels

    cudaCUDA back-endenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions