MCPcopy Create free account
hub / github.com/ROCm/AMDMIGraphX / write_to_gpu

Function write_to_gpu

src/targets/gpu/hip.cpp:151–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149}
150
151std::shared_ptr<void> write_to_gpu(const void* x, std::size_t sz, bool host)
152{
153 gpu_sync();
154 auto result = allocate_gpu(sz, host);
155 assert(host or is_device_ptr(result.get()));
156 assert(not is_device_ptr(x));
157 auto status = hipMemcpy(result.get(), x, sz, hipMemcpyHostToDevice);
158 if(status != hipSuccess)
159 MIGRAPHX_THROW("Copy to gpu failed: " + hip_error(status));
160 return result;
161}
162
163argument allocate_gpu(const shape& s, bool host)
164{

Callers 2

to_gpuFunction · 0.70
runMethod · 0.50

Calls 5

gpu_syncFunction · 0.85
allocate_gpuFunction · 0.85
is_device_ptrFunction · 0.85
hip_errorFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected