Add HYPRE_GetExecutionPolicyName (#969)
* Add HYPRE_GetExecutionPolicyName * Add doc entries to memory/execution routines
This commit is contained in:
		
							parent
							
								
									593fe4cba7
								
							
						
					
					
						commit
						57862ef6e2
					
				| @ -249,7 +249,16 @@ typedef enum _HYPRE_MemoryLocation | ||||
|    HYPRE_MEMORY_DEVICE | ||||
| } HYPRE_MemoryLocation; | ||||
| 
 | ||||
| /**
 | ||||
|  * (Optional) Sets the default (abstract) memory location. | ||||
|  **/ | ||||
| 
 | ||||
| HYPRE_Int HYPRE_SetMemoryLocation(HYPRE_MemoryLocation memory_location); | ||||
| 
 | ||||
| /**
 | ||||
|  * (Optional) Gets a pointer to the default (abstract) memory location. | ||||
|  **/ | ||||
| 
 | ||||
| HYPRE_Int HYPRE_GetMemoryLocation(HYPRE_MemoryLocation *memory_location); | ||||
| 
 | ||||
| #include <stdlib.h> | ||||
| @ -265,9 +274,24 @@ typedef enum _HYPRE_ExecutionPolicy | ||||
|    HYPRE_EXEC_DEVICE | ||||
| } HYPRE_ExecutionPolicy; | ||||
| 
 | ||||
| /**
 | ||||
|  * (Optional) Sets the default execution policy. | ||||
|  **/ | ||||
| 
 | ||||
| HYPRE_Int HYPRE_SetExecutionPolicy(HYPRE_ExecutionPolicy exec_policy); | ||||
| 
 | ||||
| /**
 | ||||
|  * (Optional) Gets a pointer to the default execution policy. | ||||
|  **/ | ||||
| 
 | ||||
| HYPRE_Int HYPRE_GetExecutionPolicy(HYPRE_ExecutionPolicy *exec_policy); | ||||
| 
 | ||||
| /**
 | ||||
|  * (Optional) Returns a string denoting the execution policy passed as input. | ||||
|  **/ | ||||
| 
 | ||||
| const char* HYPRE_GetExecutionPolicyName(HYPRE_ExecutionPolicy exec_policy); | ||||
| 
 | ||||
| /*--------------------------------------------------------------------------
 | ||||
|  * HYPRE UMPIRE | ||||
|  *--------------------------------------------------------------------------*/ | ||||
|  | ||||
| @ -662,3 +662,31 @@ HYPRE_GetExecutionPolicy(HYPRE_ExecutionPolicy *exec_policy) | ||||
| 
 | ||||
|    return hypre_error_flag; | ||||
| } | ||||
| 
 | ||||
| const char* | ||||
| HYPRE_GetExecutionPolicyName(HYPRE_ExecutionPolicy exec_policy) | ||||
| { | ||||
|    switch (exec_policy) | ||||
|    { | ||||
|       case HYPRE_EXEC_HOST: | ||||
|          return "Host"; | ||||
| 
 | ||||
|       case HYPRE_EXEC_DEVICE: | ||||
| #if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) | ||||
| #if defined(HYPRE_USING_CUDA) | ||||
|          return "Device (CUDA)"; | ||||
| #elif defined(HYPRE_USING_HIP) | ||||
|          return "Device (HIP)"; | ||||
| #elif defined(HYPRE_USING_SYCL) | ||||
|          return "Device (SYCL)"; | ||||
| #else | ||||
|          return "Device (OpenMP)"; | ||||
| #endif | ||||
| #else | ||||
|          return "Host"; | ||||
| #endif | ||||
|       case HYPRE_EXEC_UNDEFINED: | ||||
|       default: | ||||
|          return "Undefined"; | ||||
|    } | ||||
| } | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Victor A. P. Magri
						Victor A. P. Magri