Forum Discussion
Altera_Forum
Honored Contributor
8 years agoOk so I am getting far with this project and porting is getting easier. But now I am experiencing this problem when I run this kernel:
__kernel void computeRouteStrength(__global double* restrict routeStrength,__global int* restrict order ,__global double* restrict routePheromones,__global Route* restrict possibleRoutesPerOrderMatrix,
__global int* restrict cols, __global double* restrict beta, __global int* restrict dailyOrderLimit, __global int* restrict productionCapacities)
{
int i = get_global_id(0);
int route = (*order * *cols) + i;
double strength = -1;
if (possibleRoutesPerOrderMatrix.order != -1)
{
double pheromone = routePheromones;
double heuristicInformation = 1/possibleRoutesPerOrderMatrix.heuristicInformation;
if (canBeShipped(&possibleRoutesPerOrderMatrix, dailyOrderLimit, productionCapacities))
{
strength = pheromone * heuristicInformation;
}
}
routeStrength = strength;
} So basically if I remove the calculation between the if statement the kernel doesn't fail. If I do put any calculation there then it fails saying: INVALID COMMAND QUEUE. What could be the problem? The index should not be a problem also the arrays have been flattened (from 2d to 1d) and I am using them in other kernels. Thanks..