MCPcopy Create free account
hub / github.com/apache/arrow / TEST_F

Function TEST_F

cpp/src/arrow/gpu/cuda_test.cc:136–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134};
135
136TEST_F(TestCudaDevice, Basics) {
137 ASSERT_FALSE(device_->is_cpu());
138 ASSERT_TRUE(IsCudaDevice(*device_));
139 ASSERT_EQ(device_->device_number(), kGpuNumber);
140 ASSERT_GE(device_->total_memory(), 1 << 20);
141 ASSERT_NE(device_->device_name(), "");
142 ASSERT_NE(device_->ToString(), "");
143
144 ASSERT_OK_AND_ASSIGN(auto other_device, CudaDevice::Make(kGpuNumber));
145 ASSERT_FALSE(other_device->is_cpu());
146 ASSERT_TRUE(IsCudaDevice(*other_device));
147 ASSERT_EQ(other_device->device_number(), kGpuNumber);
148 ASSERT_EQ(other_device->total_memory(), device_->total_memory());
149 ASSERT_EQ(other_device->handle(), device_->handle());
150 ASSERT_EQ(other_device->device_name(), device_->device_name());
151 ASSERT_EQ(*other_device, *device_);
152
153 ASSERT_FALSE(IsCudaDevice(*cpu_device_));
154
155 // Try another device if possible
156 ASSERT_OK_AND_ASSIGN(other_device, OtherGpuDevice());
157 if (other_device != nullptr) {
158 ASSERT_FALSE(other_device->is_cpu());
159 ASSERT_EQ(other_device->device_number(), kOtherGpuNumber);
160 ASSERT_NE(*other_device, *device_);
161 ASSERT_NE(other_device->handle(), device_->handle());
162 ASSERT_NE(other_device->ToString(), device_->ToString());
163 }
164
165 ASSERT_RAISES(Invalid, CudaDevice::Make(-1));
166 ASSERT_RAISES(Invalid, CudaDevice::Make(99));
167}
168
169TEST_F(TestCudaDevice, Copy) {
170 auto cpu_buffer = Buffer::FromString("some data");

Callers

nothing calls this directly

Calls 15

IsCudaDeviceFunction · 0.85
FromStringFunction · 0.85
AssertCudaBufferEqualsFunction · 0.85
AssertBufferEqualFunction · 0.85
MakeRandomByteBufferFunction · 0.85
default_memory_poolFunction · 0.85
SliceBufferFunction · 0.85
AllocateCudaHostBufferFunction · 0.85
AllocateFunction · 0.85
MakeIntRecordBatchFunction · 0.85
CompareBatchFunction · 0.85
ArrayFromJSONFunction · 0.85

Tested by

no test coverage detected