OpenCL, C++: Unexpected Results of simple sum float vector program -
it simple program read 2 float4 vectors files calculate sum of opposite numbers. result of not expected!! the main file: #include <limits.h> #include <stdio.h> #include <stdlib.h> #include <iostream> #include <iomanip> #include <array> #include <fstream> #include <sstream> #include <string> #include <algorithm> #include <iterator> #ifdef __apple__ #include <opencl/opencl.h> #else #include <cl/cl.h> #include <time.h> #endif const int number_of_points = 16; // number of points in both , b files (number of rows) const int number_of_axis = 4; // number of points axis in both , b files (number of columns) using namespace std; void checkerror(cl_int err, const char *operation) { if (err != cl_success) { fprintf(stderr, "error during operation '%s': %d\n", operation, err); exit(1); } } int main(int argc, char *argv[]) { clock_t tstart = clock(); ...