mirror of
https://github.com/smyalygames/FiniteVolumeGPU_HIP.git
synced 2025-05-18 06:24:11 +02:00
Merge branch 'porting-to-hip' of https://github.com/HichamAgueny/FiniteVolumeGPU_HIP into porting-to-hip
This commit is contained in:
commit
5511950c65
@ -43,6 +43,20 @@ import json
|
|||||||
from hip import hip, hiprtc
|
from hip import hip, hiprtc
|
||||||
from hip import hipblas
|
from hip import hipblas
|
||||||
|
|
||||||
|
def hip_check(call_result):
|
||||||
|
err = call_result[0]
|
||||||
|
result = call_result[1:]
|
||||||
|
if len(result) == 1:
|
||||||
|
result = result[0]
|
||||||
|
if isinstance(err, hip.hipError_t) and err != hip.hipError_t.hipSuccess:
|
||||||
|
raise RuntimeError(str(err))
|
||||||
|
elif (
|
||||||
|
isinstance(err, hiprtc.hiprtcResult)
|
||||||
|
and err != hiprtc.hiprtcResult.HIPRTC_SUCCESS
|
||||||
|
):
|
||||||
|
raise RuntimeError(str(err))
|
||||||
|
return result
|
||||||
|
|
||||||
def safeCall(cmd):
|
def safeCall(cmd):
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
try:
|
try:
|
||||||
|
@ -206,6 +206,20 @@ class MPISimulator(Simulator.BaseSimulator):
|
|||||||
"""
|
"""
|
||||||
Class which handles communication between simulators on different MPI nodes
|
Class which handles communication between simulators on different MPI nodes
|
||||||
"""
|
"""
|
||||||
|
def hip_check(call_result):
|
||||||
|
err = call_result[0]
|
||||||
|
result = call_result[1:]
|
||||||
|
if len(result) == 1:
|
||||||
|
result = result[0]
|
||||||
|
if isinstance(err, hip.hipError_t) and err != hip.hipError_t.hipSuccess:
|
||||||
|
raise RuntimeError(str(err))
|
||||||
|
elif (
|
||||||
|
isinstance(err, hiprtc.hiprtcResult)
|
||||||
|
and err != hiprtc.hiprtcResult.HIPRTC_SUCCESS
|
||||||
|
):
|
||||||
|
raise RuntimeError(str(err))
|
||||||
|
return result
|
||||||
|
|
||||||
def __init__(self, sim, grid):
|
def __init__(self, sim, grid):
|
||||||
self.profiling_data_mpi = { 'start': {}, 'end': {} }
|
self.profiling_data_mpi = { 'start': {}, 'end': {} }
|
||||||
self.profiling_data_mpi["start"]["t_mpi_halo_exchange"] = 0
|
self.profiling_data_mpi["start"]["t_mpi_halo_exchange"] = 0
|
||||||
|
@ -24,7 +24,8 @@ import logging
|
|||||||
from GPUSimulators import Simulator, CudaContext
|
from GPUSimulators import Simulator, CudaContext
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
import pycuda.driver as cuda
|
#import pycuda.driver as cuda
|
||||||
|
from hip import hip, hiprtc
|
||||||
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user