diff --git a/neureka/hal/neureka_task.c b/neureka/hal/neureka_task.c index 501b2b9..16f54f8 100644 --- a/neureka/hal/neureka_task.c +++ b/neureka/hal/neureka_task.c @@ -115,6 +115,12 @@ void neureka_task_set_weight_source(neureka_task_t *task, task->data.cfg.conf0 |= weight_source; } +void neureka_task_set_activation_prefetch(neureka_task_t *task, + neureka_activation_prefetch_e activation_prefetch) { + task->data.cfg.conf0 &= ~NEUREKA_MASK_FLAG_ACTIVATION_PREFETCH; + task->data.cfg.conf0 |= activation_prefetch; +} + /** neureka_pad_ptr * * Calculate the pointer to the start of the ptr as if diff --git a/neureka/hal/neureka_task.h b/neureka/hal/neureka_task.h index 2d06468..5217a71 100644 --- a/neureka/hal/neureka_task.h +++ b/neureka/hal/neureka_task.h @@ -39,6 +39,11 @@ typedef enum neureka_weight_offset_mode_e { weightOffsetModeLayerWise = NEUREKA_FLAG_WEIGHT_OFFSET_LAYER_WISE } neureka_weight_offset_mode_e; +typedef enum neureka_activation_prefetch_e { + activationPrefetchOn = NEUREKA_FLAG_ACTIVATION_PREFETCH_ON, + activationPrefetchOff = NEUREKA_FLAG_ACTIVATION_PREFETCH_OFF +} neureka_activation_prefetch_e; + typedef enum { normMode8Bit = NEUREKA_NORM_MODE_8BIT, normMode32Bit = NEUREKA_NORM_MODE_32BIT diff --git a/neureka/hal/neureka_task_defs.h b/neureka/hal/neureka_task_defs.h index dfd74d4..7a4ca3e 100644 --- a/neureka/hal/neureka_task_defs.h +++ b/neureka/hal/neureka_task_defs.h @@ -92,7 +92,8 @@ #define NEUREKA_FLAG_STREAMIN (1 << 14) #define NEUREKA_NORM_MODE_8BIT (0 << 12) #define NEUREKA_NORM_MODE_32BIT (2 << 12) -#define NEUREKA_FLAG_ACTIVATION_PREFETCH (1 << 10) +#define NEUREKA_FLAG_ACTIVATION_PREFETCH_ON (1 << 10) +#define NEUREKA_FLAG_ACTIVATION_PREFETCH_OFF (0 << 10) #define NEUREKA_FLAG_WEIGHT_SOURCE_WMEM (1 << 9) #define NEUREKA_FLAG_WEIGHT_SOURCE_TCDM (0 << 9) #define NEUREKA_FLAG_LINEAR_MODE (1 << 7) // not tested