From b53f5bf601449108353127ff5ca2a2432a5a703d Mon Sep 17 00:00:00 2001 From: Hicham Agueny <95568317+HichamAgueny@users.noreply.github.com> Date: Tue, 20 Feb 2024 14:25:56 +0100 Subject: [PATCH 1/3] replace .cu with cu.hip --- GPUSimulators/EE2D_KP07_dimsplit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GPUSimulators/EE2D_KP07_dimsplit.py b/GPUSimulators/EE2D_KP07_dimsplit.py index 0429b28..935eb90 100644 --- a/GPUSimulators/EE2D_KP07_dimsplit.py +++ b/GPUSimulators/EE2D_KP07_dimsplit.py @@ -108,7 +108,7 @@ class EE2D_KP07_dimsplit (BaseSimulator): #self.kernel = module.get_function("KP07DimsplitKernel") #self.kernel.prepare("iiffffffiiPiPiPiPiPiPiPiPiPiiii") # - kernel_file_path = os.path.abspath(os.path.join('cuda', 'EE2D_KP07_dimsplit.cu')) + kernel_file_path = os.path.abspath(os.path.join('cuda', 'EE2D_KP07_dimsplit.cu.hip')) with open(kernel_file_path, 'r') as file: kernel_source = file.read() From 56445c201ed4c3ba5baf661f7139d7523d2c4f9a Mon Sep 17 00:00:00 2001 From: Hicham Agueny <95568317+HichamAgueny@users.noreply.github.com> Date: Tue, 20 Feb 2024 14:26:26 +0100 Subject: [PATCH 2/3] replace .cu with cu.hip --- GPUSimulators/FORCE.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GPUSimulators/FORCE.py b/GPUSimulators/FORCE.py index 22a1593..ce42285 100644 --- a/GPUSimulators/FORCE.py +++ b/GPUSimulators/FORCE.py @@ -88,7 +88,7 @@ class FORCE (Simulator.BaseSimulator): self.g = np.float32(g) #Get kernels -# module = context.get_module("cuda/SWE2D_FORCE.cu", +# module = context.get_module("cuda/SWE2D_FORCE.cu.hip", # defines={ # 'BLOCK_WIDTH': self.block_size[0], # 'BLOCK_HEIGHT': self.block_size[1] From e1992ca416814e09fbdf0b4bff5691b23ed88cc1 Mon Sep 17 00:00:00 2001 From: Hicham Agueny <95568317+HichamAgueny@users.noreply.github.com> Date: Tue, 20 Feb 2024 14:36:19 +0100 Subject: [PATCH 3/3] missing 'tab' --- GPUSimulators/FORCE.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/GPUSimulators/FORCE.py b/GPUSimulators/FORCE.py index ce42285..ebf4416 100644 --- a/GPUSimulators/FORCE.py +++ b/GPUSimulators/FORCE.py @@ -187,15 +187,14 @@ class FORCE (Simulator.BaseSimulator): ) ) ) - - self.u0, self.u1 = self.u1, self.u0 + self.u0, self.u1 = self.u1, self.u0 - hip_check(hip.hipDeviceSynchronize()) - hip_check(hip.hipModuleUnload(module)) + hip_check(hip.hipDeviceSynchronize()) + hip_check(hip.hipModuleUnload(module)) + + hip_check(hip.hipFree(cfl_data)) - hip_check(hip.hipFree(cfl_data)) - - print("--Launching Kernel .FORCEKernel. is ok") + print("--Launching Kernel .FORCEKernel. is ok") def getOutput(self): return self.u0