mirror of
https://github.com/ml-explore/mlx.git
synced 2025-10-20 01:11:44 +08:00
awni's commit files
This commit is contained in:
22
tests/tests.cpp
Normal file
22
tests/tests.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#define DOCTEST_CONFIG_IMPLEMENT
|
||||
#include "doctest/doctest.h"
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
#include "mlx/mlx.h"
|
||||
|
||||
using namespace mlx::core;
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
doctest::Context context;
|
||||
|
||||
const char* device = std::getenv("DEVICE");
|
||||
if (device != nullptr && std::string(device) == "cpu") {
|
||||
set_default_device(Device::cpu);
|
||||
} else if (metal::is_available()) {
|
||||
set_default_device(Device::gpu);
|
||||
}
|
||||
|
||||
context.applyCommandLine(argc, argv);
|
||||
return context.run();
|
||||
}
|
Reference in New Issue
Block a user