Fixed issue with aliasing local variables
ISPC++ now produces valid code, or an appropriate error message, for all of my test cases.
This commit is contained in:
27
tests_ispcpp/varying.cpp
Normal file
27
tests_ispcpp/varying.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "varying.h"
|
||||
|
||||
int main() {
|
||||
float A[256];
|
||||
double B[256];
|
||||
double outA[256];
|
||||
double outB[256];
|
||||
|
||||
|
||||
for (int i=0; i<256; i++) {
|
||||
A[i] = 1. / (i+1);
|
||||
B[i] = 1. / (i+1);
|
||||
}
|
||||
|
||||
ispc::square(256, (float*)&A, (double*)&outA);
|
||||
|
||||
ispc::square(256, (double*)&B, (double*)&outB);
|
||||
|
||||
for (int i=0; i<256; i++) {
|
||||
printf("float: %.16f\tdouble: %.16f\n", outA[i], outB[i]);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user