Using krnls_wa for Computing the weighted_average Weights - 2023.2 日本語

Vitis チュートリアル: ハードウェア アクセラレーション (XD099)

Document ID
XD099
Release Date
2023-11-13
Version
2023.2 日本語
const float b = 0.15;
const unsigned int p = 4;

static void compute(float* cost,float* flow_free_time,float* Volume,float* capacity,float* weight, 
                    int size){

    for (int i =0; i < size; i++){
        weight[i] = 0.6 * cost[i] +  0.4 * flow_free_time[i]*(1 + b*powf(Volume[i]/capacity[i],p));
    }
}
extern "C" {

void weight_average(float* cost,float* flow_free_time,float* Volume,float* capacity,float* weight, 
                    int size) {

        compute(cost,flow_free_time,Volume,capacity,weight,size);
    
  }
}