mirror of
				https://github.com/smyalygames/FiniteVolumeGPU.git
				synced 2025-10-31 20:17:41 +01:00 
			
		
		
		
	feat(common): add a common hip_check function
This commit is contained in:
		
							parent
							
								
									b8836f4fb0
								
							
						
					
					
						commit
						189eb42603
					
				| @ -1,3 +1,4 @@ | ||||
| # Objects | ||||
| from GPUSimulators.common.arrays.cuda.arkawa2d import ArakawaA2D | ||||
| from .common import * | ||||
| from GPUSimulators.common.arrays.cuda.array2d import CudaArray2D | ||||
| @ -6,4 +7,7 @@ from .data_dumper import DataDumper | ||||
| from .ip_engine import IPEngine | ||||
| from .popen_file_buffer import PopenFileBuffer | ||||
| from .progress_printer import ProgressPrinter | ||||
| from .timer import Timer | ||||
| from .timer import Timer | ||||
| 
 | ||||
| # Functions | ||||
| from .hip_check import hip_check | ||||
							
								
								
									
										15
									
								
								GPUSimulators/common/hip_check.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								GPUSimulators/common/hip_check.py
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,15 @@ | ||||
| from hip import hip | ||||
| 
 | ||||
| 
 | ||||
| def hip_check(call_request): | ||||
|     """ | ||||
|     Function that checks if the HIP function executed successfully. | ||||
|     """ | ||||
| 
 | ||||
|     err = call_request[0] | ||||
|     result = call_request[1:] | ||||
|     if len(result) == 1: | ||||
|         result = result[0] | ||||
|     if isinstance(err, hip.hipError_t) and err != hip.hipError_t.hipSuccess: | ||||
|         raise RuntimeError(str(err)) | ||||
|     return result | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Anthony Berg
						Anthony Berg