1414
1515
1616@pytest .fixture
17- def _sample_function_templates ():
17+ def sample_function_templates ():
1818 DATA_FOLDER = os .path .join (os .path .dirname (__file__ ), "data" )
1919 p = os .path .join (DATA_FOLDER , "sample_function_template.cuh" )
2020 decls = parse_declarations_from_source (p , [p ], "sm_80" , verbose = True )
@@ -37,8 +37,8 @@ def find_binding(bindings, name):
3737 )
3838
3939
40- def test_templated_function_overload_selection (_sample_function_templates ):
41- func_bindings , shim_writer = _sample_function_templates
40+ def test_templated_function_overload_selection (sample_function_templates ):
41+ func_bindings , shim_writer = sample_function_templates
4242 add = find_binding (func_bindings , "add" )
4343
4444 @cuda .jit (link = shim_writer .links ())
@@ -55,8 +55,8 @@ def kernel(x, y, z, out):
5555 np .testing .assert_allclose (out , np .array ([3.0 , 6.0 ], dtype = np .float32 ))
5656
5757
58- def test_templated_function_explicit_specialization (_sample_function_templates ):
59- func_bindings , shim_writer = _sample_function_templates
58+ def test_templated_function_explicit_specialization (sample_function_templates ):
59+ func_bindings , shim_writer = sample_function_templates
6060 add = find_binding (func_bindings , "add" )
6161
6262 @cuda .jit (link = shim_writer .links ())
@@ -76,8 +76,8 @@ def kernel(int_a, int_b, float_a, float_b, out_int, out_float):
7676 np .testing .assert_allclose (out_float , np .array ([4.0 ], dtype = np .float32 ))
7777
7878
79- def test_templated_function_default_non_type (_sample_function_templates ):
80- func_bindings , shim_writer = _sample_function_templates
79+ def test_templated_function_default_non_type (sample_function_templates ):
80+ func_bindings , shim_writer = sample_function_templates
8181 add_default = find_binding (func_bindings , "add_default" )
8282
8383 @cuda .jit (link = shim_writer .links ())
@@ -91,8 +91,8 @@ def kernel(inp, out):
9191 assert out [0 ] == 17
9292
9393
94- def test_templated_function_default_type (_sample_function_templates ):
95- func_bindings , shim_writer = _sample_function_templates
94+ def test_templated_function_default_type (sample_function_templates ):
95+ func_bindings , shim_writer = sample_function_templates
9696 add_default_type = find_binding (func_bindings , "add_default_type" )
9797
9898 @cuda .jit (link = shim_writer .links ())
@@ -107,9 +107,9 @@ def kernel(inp, out):
107107
108108
109109def test_templated_function_multiple_template_args (
110- _sample_function_templates ,
110+ sample_function_templates ,
111111):
112- func_bindings , shim_writer = _sample_function_templates
112+ func_bindings , shim_writer = sample_function_templates
113113 add_cast = find_binding (func_bindings , "add_cast" )
114114
115115 @cuda .jit (link = shim_writer .links ())
@@ -125,9 +125,9 @@ def kernel(int_a, float_b, out):
125125
126126
127127def test_templated_function_type_and_non_type (
128- _sample_function_templates ,
128+ sample_function_templates ,
129129):
130- func_bindings , shim_writer = _sample_function_templates
130+ func_bindings , shim_writer = sample_function_templates
131131 add_with_non_type = find_binding (func_bindings , "add_with_non_type" )
132132
133133 @cuda .jit (link = shim_writer .links ())
0 commit comments