Files
ispc/tests_ispcpp/hello.cpp
Aaron Gutierrez 5e6f06cf59 Fixed issue with aliasing local variables
ISPC++ now produces valid code, or an appropriate error message, for all
of my test cases.
2017-05-11 15:42:11 -04:00

24 lines
388 B
C++

#include <stdlib.h>
#include <stdio.h>
#include "hello.h"
int main() {
float A[100];
float B[100];
double result[100];
for (int i=0; i<100; i++) {
A[i] = 100 - i;
B[i] = i*i;
}
ispc::saxpy(100, 3.1415926535, (float*)&A, (float*)&B, (double*)&result);
for (int i=0; i<100; i++) {
printf("%.6f\n", result[i]);
}
return 0;
}