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

Function TEST_F

dnn/test/cuda/megcore/device.cpp:8–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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