the memory of this test case is too large, sometimes will fail on tx1
| 59 | |
| 60 | //! the memory of this test case is too large, sometimes will fail on tx1 |
| 61 | TEST_F(ROCM, ELEMWISE_BENCHMARK_DENSE) { |
| 62 | constexpr size_t A = 1024 * 1024 * 64, S0 = 64, S1 = 256, S2 = 64, S3 = 64; |
| 63 | static_assert(A == S0 * S1 * S2 * S3, "bad value"); |
| 64 | SyncedTensor<> t0(handle_rocm(), {TensorShape{S0, S1, S2, S3}, dtype::Float32()}), |
| 65 | t1(handle_rocm(), {TensorShape{S0, S1, S2, S3}, dtype::Float32()}); |
| 66 | UniformFloatRNG rng{-2.f, 2.f}; |
| 67 | rng.gen(t0.tensornd_host()); |
| 68 | run_tensor_add( |
| 69 | handle_rocm(), t0.tensornd_dev(), t0.tensornd_dev(), t1.tensornd_dev()); |
| 70 | auto p0 = t0.ptr_host(), p1 = t1.ptr_host(); |
| 71 | for (size_t i = 0; i < A; ++i) { |
| 72 | ASSERT_EQ(p0[i] + p0[i], p1[i]) << "at index " << i << "/" << A; |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | #if MEGDNN_WITH_BENCHMARK |
| 77 | TEST_F(ROCM, ELEMWISE_BENCHMARK_BCAST_101) { |
nothing calls this directly
no test coverage detected