Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions cupy/cuda/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,12 @@ def compile_using_nvrtc(source, options=(), arch=None, filename='kern.cu',
def _compile(
source, options, cu_path, name_expressions, log_stream, jitify):

if not runtime.is_hip:
arch_opt, method = _get_arch_for_options_for_nvrtc(arch)
options += (arch_opt,)
else:
method = 'ptx'

if jitify:
options, headers, include_names = _jitify_prep(
source, options, cu_path)
Expand All @@ -291,12 +297,6 @@ def _compile(
# tests cause an error if the following option is not included.
options += ('--device-as-default-execution-space',)

if not runtime.is_hip:
arch_opt, method = _get_arch_for_options_for_nvrtc(arch)
options += (arch_opt,)
else:
method = 'ptx'

prog = _NVRTCProgram(source, cu_path, headers, include_names,
name_expressions=name_expressions, method=method)
try:
Expand Down
4 changes: 3 additions & 1 deletion tests/cupy_tests/core_tests/test_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,9 @@ def test_dynamical_parallelism_compile_failure(self):
x = cupy.zeros((N,), dtype=cupy.float32)
use_ptx = os.environ.get(
'CUPY_COMPILE_WITH_PTX', False)
if self.backend == 'nvrtc' and (
if self.jitify:
error = cupy.cuda.compiler.JitifyException
elif self.backend == 'nvrtc' and (
use_ptx or
(cupy.cuda.driver._is_cuda_python()
and cupy.cuda.runtime.runtimeGetVersion() < 11010) or
Expand Down