Exemplo n.º 1
0
static int check(size_t* start, size_t* count)
{
    int ok = 1;
    Odom* odom = odom_create(RANK);
    float* result = (float*)threeD;
    float* expected = (float*)threeD;
    odom_set(odom,start,count);
    while(odom_more(odom)) {
	size_t offset = odom_count(odom);
	if(floateq(result[offset],expected[offset])) {
	    fprintf(stderr,"fail: result[%lu] = %f ; expected[%lu] = %f\n",
		(long unsigned)offset,result[offset],(long unsigned)offset,expected[offset]);
	    ok=0;
	}
        odom_incr(odom);
    }
    odom_reclaim(odom);
    return ok;
}
Exemplo n.º 2
0
static int
check(size_t* start, size_t* count)
{
    int ok = 1;
    int index = 0;
    Odom* odom = odom_create(RANK);
    odom_set(odom,start,count);
    float* result = (float*)target;
    float* expected = (float*)target_data;
    for(index=0;odom_more(odom);odom_incr(odom),index++) {
	size_t offset = odom_count(odom);
	if(!floateq(result[index],expected[offset])) {
	    fprintf(stderr,"fail: result[%lu] = %f ; expected[%lu] = %f\n",
		index,result[index],offset,expected[offset]);
	    ok=0;
	}
    }
    odom_reclaim(odom);
    return ok;
}
Exemplo n.º 3
0
static int
check(float* target, size_t* start, size_t* count)
{
    int ok = 1;
    Odom* odom = odom_create(RANK);
    float* result = (float*)target;
    float* expected = (float*)target_content;
    odom_set(odom,start,count);
    while(odom_more(odom)) {
	size_t offset = odom_count(odom);
	int eq = floateq(result[offset],expected[offset]);
	if(eq == 0) {
	    fprintf(stderr,"fail: result[%lu] = %f ; expected[%lu] = %f\n",
		offset,result[offset],offset,expected[offset]);
	    ok=0;
	}
        odom_incr(odom);
    }
    odom_reclaim(odom);
    return ok;
}