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

Method set_device

src/core/test/mem_alloc.cpp:516–516  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

514class CudaDevicePolicy : public DevicePolicy {
515public:
516 void set_device(int device) override { MGB_CUDA_CHECK(cudaSetDevice(device)); }
517 void get_mem_info(size_t& free, size_t& tot) override {
518 MGB_CUDA_CHECK(cudaMemGetInfo(&free, &tot));
519 }

Callers 1

test_free_memFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected