mirror of
https://github.com/ml-explore/mlx.git
synced 2025-09-27 00:08:09 +08:00
Run CPP tests for CUDA build in CI (#2544)
This commit is contained in:
@@ -10,7 +10,7 @@ using namespace mlx::core;
|
||||
|
||||
TEST_CASE("test device placement") {
|
||||
auto device = default_device();
|
||||
Device d = metal::is_available() ? Device::gpu : Device::cpu;
|
||||
Device d = gpu::is_available() ? Device::gpu : Device::cpu;
|
||||
if (std::getenv("DEVICE") == nullptr) {
|
||||
CHECK_EQ(device, d);
|
||||
}
|
||||
@@ -18,7 +18,7 @@ TEST_CASE("test device placement") {
|
||||
array x(1.0f);
|
||||
array y(1.0f);
|
||||
auto z = add(x, y, default_device());
|
||||
if (metal::is_available()) {
|
||||
if (gpu::is_available()) {
|
||||
z = add(x, y, Device::gpu);
|
||||
z = add(x, y, Device(Device::gpu, 0));
|
||||
} else {
|
||||
|
@@ -16,7 +16,7 @@ TEST_CASE("test stream management") {
|
||||
CHECK_NE(s1, s2);
|
||||
|
||||
// Check that default streams have the correct devices
|
||||
if (metal::is_available()) {
|
||||
if (gpu::is_available()) {
|
||||
auto s_gpu = default_stream(Device::gpu);
|
||||
CHECK_EQ(s_gpu.device, Device::gpu);
|
||||
} else {
|
||||
@@ -28,7 +28,7 @@ TEST_CASE("test stream management") {
|
||||
s_cpu = new_stream(Device::cpu);
|
||||
CHECK_EQ(s_cpu.device, Device::cpu);
|
||||
|
||||
if (metal::is_available()) {
|
||||
if (gpu::is_available()) {
|
||||
auto s_gpu = new_stream(Device::gpu);
|
||||
CHECK_EQ(s_gpu.device, Device::gpu);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user