| 149 | } |
| 150 | |
| 151 | std::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 | |
| 163 | argument allocate_gpu(const shape& s, bool host) |
| 164 | { |
no test coverage detected