MCPcopy Create free account
hub / github.com/ROCm/AMDMIGraphX / TEST_CASE

Function TEST_CASE

test/gpu/literal.cpp:33–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31#include <migraphx/gpu/hip.hpp>
32
33TEST_CASE(gpu_literal_test)
34{
35 migraphx::program p;
36 auto* mm = p.get_main_module();
37 auto lit = generate_literal(migraphx::shape{migraphx::shape::float_type, {4, 3, 3, 3}});
38 mm->add_literal(lit);
39 p.compile(migraphx::make_target("gpu"));
40 auto scratch = p.get_parameter("scratch");
41 if(scratch == mm->end())
42 {
43 auto result = p.eval({}).back();
44 EXPECT(lit == migraphx::gpu::from_gpu(result));
45 }
46 else
47 {
48 EXPECT(scratch->get_shape().bytes() == lit.get_shape().bytes());
49 }
50}
51
52int main(int argc, const char* argv[]) { test::run(argc, argv); }

Callers

nothing calls this directly

Calls 12

generate_literalFunction · 0.85
make_targetFunction · 0.85
from_gpuFunction · 0.85
get_main_moduleMethod · 0.80
backMethod · 0.80
add_literalMethod · 0.45
compileMethod · 0.45
get_parameterMethod · 0.45
endMethod · 0.45
evalMethod · 0.45
bytesMethod · 0.45
get_shapeMethod · 0.45

Tested by

no test coverage detected