Mentions légales du service

Skip to content
Snippets Groups Projects
Commit e6bb66c8 authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

control: Add a copy of the defines as integer to silent the warning on the switch case

parent 465d34b5
No related branches found
No related tags found
1 merge request!492Fix pedantic compilation warnings
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
* @author Raphael Boucherie * @author Raphael Boucherie
* @author Samuel Thibault * @author Samuel Thibault
* @author Lionel Eyraud-Dubois * @author Lionel Eyraud-Dubois
* @date 2023-07-06 * @date 2024-10-18
* *
*** ***
* *
...@@ -295,7 +295,7 @@ int chameleon_desc_init_internal( CHAM_desc_t *desc, const char *name, void *mat ...@@ -295,7 +295,7 @@ int chameleon_desc_init_internal( CHAM_desc_t *desc, const char *name, void *mat
desc->ooc = 0; desc->ooc = 0;
switch ( (intptr_t)mat ) { switch ( (intptr_t)mat ) {
case (intptr_t)CHAMELEON_MAT_ALLOC_TILE: case CHAMELEON_MAT_CASE_ALLOC_TILE:
if ( chamctxt->scheduler == RUNTIME_SCHED_STARPU ) { if ( chamctxt->scheduler == RUNTIME_SCHED_STARPU ) {
/* Let's use the allocation on the fly as in OOC */ /* Let's use the allocation on the fly as in OOC */
desc->get_blkaddr = chameleon_getaddr_null; desc->get_blkaddr = chameleon_getaddr_null;
...@@ -305,13 +305,13 @@ int chameleon_desc_init_internal( CHAM_desc_t *desc, const char *name, void *mat ...@@ -305,13 +305,13 @@ int chameleon_desc_init_internal( CHAM_desc_t *desc, const char *name, void *mat
/* Otherwise we switch back to the full allocation */ /* Otherwise we switch back to the full allocation */
chameleon_attr_fallthrough; chameleon_attr_fallthrough;
case (intptr_t)CHAMELEON_MAT_ALLOC_GLOBAL: case CHAMELEON_MAT_CASE_ALLOC_GLOBAL:
rc = chameleon_desc_mat_alloc( desc ); rc = chameleon_desc_mat_alloc( desc );
desc->alloc_mat = 1; desc->alloc_mat = 1;
desc->use_mat = 1; desc->use_mat = 1;
break; break;
case (intptr_t)CHAMELEON_MAT_OOC: case CHAMELEON_MAT_CASE_OOC:
if ( chamctxt->scheduler != RUNTIME_SCHED_STARPU ) { if ( chamctxt->scheduler != RUNTIME_SCHED_STARPU ) {
chameleon_error("CHAMELEON_Desc_Create", "CHAMELEON Out-of-Core descriptors are supported only with StarPU"); chameleon_error("CHAMELEON_Desc_Create", "CHAMELEON Out-of-Core descriptors are supported only with StarPU");
return CHAMELEON_ERR_NOT_SUPPORTED; return CHAMELEON_ERR_NOT_SUPPORTED;
......
...@@ -353,6 +353,13 @@ typedef enum chameleon_translation_e { ...@@ -353,6 +353,13 @@ typedef enum chameleon_translation_e {
#define CHAMELEON_MAT_ALLOC_TILE ((void*)-1) #define CHAMELEON_MAT_ALLOC_TILE ((void*)-1)
#define CHAMELEON_MAT_OOC ((void*)-2) #define CHAMELEON_MAT_OOC ((void*)-2)
/**
* @brief Integer constant matching the previous ones for case values
*/
#define CHAMELEON_MAT_CASE_ALLOC_GLOBAL 0
#define CHAMELEON_MAT_CASE_ALLOC_TILE -1
#define CHAMELEON_MAT_CASE_OOC -2
/** /**
* CHAMELEON constants - success & error codes * CHAMELEON constants - success & error codes
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment