Skip to content

Commit

Permalink
expose prefetch option in N-EUREKA
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancescoConti committed Feb 19, 2024
1 parent 89da402 commit bbd4b7a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions neureka/hal/neureka_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions neureka/hal/neureka_task.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion neureka/hal/neureka_task_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bbd4b7a

Please sign in to comment.