Apply patch to fix test on ROCm backend
@@ -4,12 +4,16 @@ import pytest
import numpy
import cupy
+from cupy.core import core
from cupy.cuda import compiler
+from cupy.cuda import runtime
from cupy import testing
def _compile_func(kernel_name, code):
- mod = compiler.compile_with_cache(code)
+ # workaround for hipRTC
+ extra_source = core._get_header_source() if runtime.is_hip else None
+ mod = compiler.compile_with_cache(code, extra_source=extra_source)
return mod.get_function(kernel_name)
