Skip to content

Commit

Permalink
cleaner test
Browse files Browse the repository at this point in the history
  • Loading branch information
marty1885 committed Nov 17, 2024
1 parent 181a992 commit cb4bfd2
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions tests/test-metalium.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,25 +318,24 @@ int main()
{
ggml_backend_t cpu = ggml_backend_cpu_init();

ggml_backend_t metalium = NULL;
for (size_t i = 0; i < ggml_backend_reg_count(); i++) {
ggml_backend_reg_t reg = ggml_backend_reg_by_name("Metalium");
GGML_ASSERT(ggml_backend_reg_dev_count(reg) > 0);
metalium = ggml_backend_dev_init(ggml_backend_reg_dev_get(reg, 0), NULL);
break;
ggml_backend_reg_t reg = ggml_backend_reg_by_name("Metalium");
if(reg == NULL) {
fprintf(stderr, "Cannot find the Metalium backend. Is the Meralium backend disabled?\n");
return 1;
}
if(metalium == NULL) {
printf("Cannot find Metalium backend\n");
if(ggml_backend_reg_dev_count(reg) == 0) {
fprintf(stderr, "No devices found for Metalium backend. Is the kernel driver working?\n");
return 1;
}
ggml_backend_t metalium = ggml_backend_dev_init(ggml_backend_reg_dev_get(reg, 0), NULL);

std::vector<std::unique_ptr<test_case>> tests;

const ggml_unary_op supported_unary_ops[] = {
GGML_UNARY_OP_ABS,
GGML_UNARY_OP_SGN,
GGML_UNARY_OP_NEG,
// GGML_UNARY_OP_STEP, // Not supported by Metalium
GGML_UNARY_OP_STEP, // Not supported by Metalium
GGML_UNARY_OP_TANH,
GGML_UNARY_OP_ELU,
GGML_UNARY_OP_RELU,
Expand Down

0 comments on commit cb4bfd2

Please sign in to comment.