MCPcopy Create free account
hub / github.com/antirez/ds4 / test_read_vector_case

Function test_read_vector_case

tests/ds4_test.c:778–792  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

776 in_dim, out1_dim, x, 1) != 0);
777 TEST_ASSERT(ds4_gpu_matmul_q8_0_pair_tensor(pair0, pair1,
778 weights_raw, weight_alloc,
779 0, weight1_offset,
780 in_dim, out0_dim, out1_dim,
781 x, 1) != 0);
782 TEST_ASSERT(ds4_gpu_tensor_read(ref0, 0, ref0_host, out0_bytes) != 0);
783 TEST_ASSERT(ds4_gpu_tensor_read(ref1, 0, ref1_host, out1_bytes) != 0);
784 TEST_ASSERT(ds4_gpu_tensor_read(pair0, 0, pair0_host, out0_bytes) != 0);
785 TEST_ASSERT(ds4_gpu_tensor_read(pair1, 0, pair1_host, out1_bytes) != 0);
786
787 uint32_t mismatch0 = 0;
788 uint32_t mismatch1 = 0;
789 float max_abs0 = 0.0f;
790 float max_abs1 = 0.0f;
791 for (uint32_t i = 0; i < out0_dim; i++) {
792 if (memcmp(&ref0_host[i], &pair0_host[i], sizeof(float)) != 0) mismatch0++;
793 const float err = fabsf(ref0_host[i] - pair0_host[i]);
794 if (err > max_abs0) max_abs0 = err;
795 }

Callers 2

test_load_mpp_casesFunction · 0.85

Calls 1

test_trim_lineFunction · 0.85

Tested by

no test coverage detected