| 16 | } |
| 17 | |
| 18 | ROCMComputingContext::ROCMComputingContext( |
| 19 | megcoreDeviceHandle_t dev_handle, unsigned int flags, const ROCMContext& ctx) |
| 20 | : ComputingContext(dev_handle, flags), |
| 21 | own_stream_{ctx.stream == nullptr}, |
| 22 | context_{ctx} { |
| 23 | megcorePlatform_t platform; |
| 24 | megcoreGetPlatform(dev_handle, &platform); |
| 25 | megdnn_assert(platform == megcorePlatformROCM); |
| 26 | if (own_stream_) { |
| 27 | hip_check(hipStreamCreateWithFlags(&context_.stream, hipStreamNonBlocking)); |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | ROCMComputingContext::~ROCMComputingContext() { |
| 32 | if (own_stream_) { |
nothing calls this directly
no test coverage detected