mirror of
				https://github.com/smyalygames/FiniteVolumeGPU.git
				synced 2025-10-31 20:17:41 +01:00 
			
		
		
		
	feat(kernel): make handling path and file extension for kernel by respective Context
This commit is contained in:
		
							parent
							
								
									d4607183aa
								
							
						
					
					
						commit
						4da604737a
					
				| @ -221,7 +221,7 @@ class CudaContext(object): | ||||
|             if error_str: | ||||
|                 self.logger.debug(f"Error: {error_str}") | ||||
| 
 | ||||
|         kernel_filename = os.path.normpath(kernel_filename) | ||||
|         kernel_filename = os.path.normpath("cuda/" + kernel_filename + ".cu") | ||||
|         kernel_path = os.path.abspath(os.path.join(self.module_path, kernel_filename)) | ||||
|         # self.logger.debug("Getting %s", kernel_filename) | ||||
| 
 | ||||
|  | ||||
| @ -91,7 +91,7 @@ class HIPContext(Context): | ||||
|             if error_str: | ||||
|                 self.logger.debug(f"Compilation error: {error_str}") | ||||
| 
 | ||||
|         kernel_filename = os.path.normpath(kernel_filename) | ||||
|         kernel_filename = os.path.normpath("hip/" + kernel_filename + ".hip") | ||||
|         kernel_path = os.path.abspath(os.path.join(self.module_path, kernel_filename)) | ||||
| 
 | ||||
|         # Create a hash of the kernel options | ||||
|  | ||||
| @ -74,7 +74,7 @@ class EE2DKP07Dimsplit(BaseSimulator): | ||||
|         self.theta = np.float32(theta) | ||||
| 
 | ||||
|         # Get kernels | ||||
|         module = context.get_module("cuda/EE2D_KP07_dimsplit.cu", | ||||
|         module = context.get_module("EE2D_KP07_dimsplit", | ||||
|                                     defines={ | ||||
|                                         'BLOCK_WIDTH': self.block_size[0], | ||||
|                                         'BLOCK_HEIGHT': self.block_size[1] | ||||
|  | ||||
| @ -72,7 +72,7 @@ class Force(Simulator.BaseSimulator): | ||||
|         self.g = np.float32(g) | ||||
| 
 | ||||
|         # Get kernels | ||||
|         module = context.get_module("cuda/SWE2D_FORCE.cu", | ||||
|         module = context.get_module("SWE2D_FORCE", | ||||
|                                     defines={ | ||||
|                                         'BLOCK_WIDTH': self.block_size[0], | ||||
|                                         'BLOCK_HEIGHT': self.block_size[1] | ||||
|  | ||||
| @ -71,7 +71,7 @@ class HLL(Simulator.BaseSimulator): | ||||
|         self.g = np.float32(g) | ||||
| 
 | ||||
|         # Get kernels | ||||
|         module = context.get_module("cuda/SWE2D_HLL.cu", | ||||
|         module = context.get_module("SWE2D_HLL", | ||||
|                                     defines={ | ||||
|                                         'BLOCK_WIDTH': self.block_size[0], | ||||
|                                         'BLOCK_HEIGHT': self.block_size[1] | ||||
|  | ||||
| @ -73,7 +73,7 @@ class HLL2(Simulator.BaseSimulator): | ||||
|         self.theta = np.float32(theta) | ||||
| 
 | ||||
|         # Get kernels | ||||
|         module = context.get_module("cuda/SWE2D_HLL2.cu", | ||||
|         module = context.get_module("SWE2D_HLL2", | ||||
|                                     defines={ | ||||
|                                         'BLOCK_WIDTH': self.block_size[0], | ||||
|                                         'BLOCK_HEIGHT': self.block_size[1] | ||||
|  | ||||
| @ -80,7 +80,7 @@ class KP07(Simulator.BaseSimulator): | ||||
|         self.order = np.int32(order) | ||||
| 
 | ||||
|         # Get kernels | ||||
|         module = context.get_module("cuda/SWE2D_KP07.cu", | ||||
|         module = context.get_module("SWE2D_KP07", | ||||
|                                     defines={ | ||||
|                                         'BLOCK_WIDTH': self.block_size[0], | ||||
|                                         'BLOCK_HEIGHT': self.block_size[1] | ||||
|  | ||||
| @ -80,7 +80,7 @@ class KP07Dimsplit(Simulator.BaseSimulator): | ||||
|         self.theta = np.float32(theta) | ||||
| 
 | ||||
|         # Get kernels | ||||
|         module = context.get_module("cuda/SWE2D_KP07_dimsplit.cu", | ||||
|         module = context.get_module("SWE2D_KP07_dimsplit", | ||||
|                                     defines={ | ||||
|                                         'BLOCK_WIDTH': self.block_size[0], | ||||
|                                         'BLOCK_HEIGHT': self.block_size[1] | ||||
|  | ||||
| @ -73,7 +73,7 @@ class LxF(Simulator.BaseSimulator): | ||||
|         self.g = np.float32(g) | ||||
| 
 | ||||
|         # Get kernels | ||||
|         module = context.get_module("cuda/SWE2D_LxF.cu", | ||||
|         module = context.get_module("SWE2D_LxF", | ||||
|                                     defines={ | ||||
|                                         'BLOCK_WIDTH': self.block_size[0], | ||||
|                                         'BLOCK_HEIGHT': self.block_size[1] | ||||
|  | ||||
| @ -72,7 +72,7 @@ class WAF(Simulator.BaseSimulator): | ||||
|         self.g = np.float32(g) | ||||
| 
 | ||||
|         # Get kernels | ||||
|         module = context.get_module("cuda/SWE2D_WAF.cu", | ||||
|         module = context.get_module("SWE2D_WAF", | ||||
|                                     defines={ | ||||
|                                         'BLOCK_WIDTH': self.block_size[0], | ||||
|                                         'BLOCK_HEIGHT': self.block_size[1] | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Anthony Berg
						Anthony Berg