Replicates all needed state between expanded functions
commit5e6f06cf59Author: Aaron Gutierrez <gutierrez.aaron.m@gmail.com> Date: Thu May 11 15:42:11 2017 -0400 Fixed issue with aliasing local variables ISPC++ now produces valid code, or an appropriate error message, for all of my test cases. commitbfe723e1b7Author: Aaron Gutierrez <gutierrez.aaron.m@gmail.com> Date: Thu May 11 03:09:38 2017 -0400 Actually copy the AST. Type replacement works except for function parameters. commitf65b3e6300Author: Aaron Gutierrez <gutierrez.aaron.m@gmail.com> Date: Thu May 11 01:19:50 2017 -0400 [WIP] Remove cases for ForeachStmt and SymbolExpr commit2e28640860Merge:6a91c5dd020107Author: Aaron Gutierrez <gutierrez.aaron.m@gmail.com> Date: Wed May 10 23:13:40 2017 -0400 Merge branch 'master' into copy_ast commit6a91c5d5acAuthor: Aaron Gutierrez <gutierrez.aaron.m@gmail.com> Date: Wed May 10 11:11:39 2017 -0400 Attempt to replicate AST when expanding polytypes
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
CXX=g++
|
||||
CXXFLAGS=-std=c++11
|
||||
CXXFLAGS=-std=c++11 -O2
|
||||
|
||||
ISPC=../ispc
|
||||
ISPCFLAGS=--target=sse4-x2 -O2 --arch=x86-64
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "hello.ispc.h"
|
||||
#include "hello.h"
|
||||
|
||||
int main() {
|
||||
float A[100];
|
||||
|
||||
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;
|
||||
}
|
||||
14
tests_ispcpp/varying.ispc
Normal file
14
tests_ispcpp/varying.ispc
Normal file
@@ -0,0 +1,14 @@
|
||||
floating foo(const uniform int a, floating b) {
|
||||
floating out = b;
|
||||
for (int i = 1; i<a; i++) {
|
||||
out *= b;
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
export void square(uniform int N, uniform floating b[], uniform double out[]) {
|
||||
foreach (i = 0 ... N) {
|
||||
out[i] = foo(2, b[i]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user