MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / ROCMComputingContext

Method ROCMComputingContext

dnn/src/rocm/megcore/rocm_computing_context.cpp:18–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16}
17
18ROCMComputingContext::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
31ROCMComputingContext::~ROCMComputingContext() {
32 if (own_stream_) {

Callers

nothing calls this directly

Calls 1

megcoreGetPlatformFunction · 0.85

Tested by

no test coverage detected