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

Function TEST_F

dnn/test/rocm/megcore/device.cpp:9–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7#include "test/rocm/utils.h"
8
9TEST_F(MegcoreROCM, DEVICE) {
10 for (int id = -1; id < std::min(nr_devices(), 2); ++id) {
11 megcoreDeviceHandle_t handle;
12 megcoreCreateDeviceHandle(&handle, megcorePlatformROCM, id, 0);
13
14 int deviceID;
15 megcoreGetDeviceID(handle, &deviceID);
16 ASSERT_EQ(id, deviceID);
17
18 megcorePlatform_t platform;
19 megcoreGetPlatform(handle, &platform);
20 ASSERT_EQ(megcorePlatformROCM, platform);
21
22 unsigned int flags;
23 megcoreGetDeviceFlags(handle, &flags);
24 ASSERT_EQ(0u, flags);
25
26 size_t memAlignmentInBytes;
27 megcoreGetMemAlignment(handle, &memAlignmentInBytes);
28
29 megcoreActivate(handle);
30
31 void* ptr;
32 megcoreMalloc(handle, &ptr, 256);
33 megcoreFree(handle, ptr);
34
35 megcoreDestroyDeviceHandle(handle);
36 }
37}
38
39TEST_F(MegcoreROCM, ERROR_MSG) {
40#if MEGDNN_ENABLE_EXCEPTIONS

Callers

nothing calls this directly

Calls 11

nr_devicesFunction · 0.85
megcoreGetDeviceIDFunction · 0.85
megcoreGetPlatformFunction · 0.85
megcoreGetDeviceFlagsFunction · 0.85
megcoreGetMemAlignmentFunction · 0.85
megcoreActivateFunction · 0.85
megcoreMallocFunction · 0.85
megcoreFreeFunction · 0.85
minFunction · 0.50

Tested by

no test coverage detected