1 #pragma version(1) 2 #pragma rs java_package_name(foo) 3 4 // "Divergent" = reflected code must have a runtime check for 32-bit 5 // versus 64-bit target. 6 7 // non-divergent 8 int intVar; 9 10 // non-divergent 11 int intArray[10]; 12 13 // non-divergent 14 rs_matrix2x2 matVar; 15 16 // non-divergent 17 rs_matrix2x2 matArray[10]; 18 19 // divergent 20 rs_allocation allocVar; 21 22 // divergent 23 rs_allocation allocArray[10]; 24 25 struct NonDivergent { 26 int i; 27 int j; 28 }; 29 30 struct NonDivergent ndVar; 31 32 struct NonDivergent ndArray[10]; 33 34 // 32-bit: 12 bytes; 64-bit: 48 bytes 35 struct Divergent { 36 int i; 37 rs_allocation a; 38 int j; 39 }; 40 41 struct Divergent dVar; 42 43 struct Divergent dArray[10]; 44 45 // 32-bit: 20 bytes; 64-bit: 64 bytes 46 struct DivergentNest { 47 int x; 48 struct Divergent d; 49 int y; 50 }; 51 52 #if 0 53 54 // TODO: Add these variables back once http://b/65210157 is fixed 55 56 struct DivergentNest dnVar; 57 58 struct DivergentNest dnArray[10]; 59 60 #endif 61 62 void intFe(const int *in, int *out, const int *data) { } 63 64 void matFe(const int *in, int *out, const rs_matrix2x2 *data) { } 65 66 void allocFe(const int *in, int *out, const rs_allocation *data) { } 67 68 void ndFe(const int *in, int *out, const struct NonDivergent *data) { } 69 70 void dFe(const int *in, int *out, const struct Divergent *data) { } 71 72 void dnFe(const int *in, int *out, const struct DivergentNest *data) { } 73 74 // for arguments, should get a helper struct that looks like struct NonDivergent 75 void ndInv(int i, int j) { } 76 77 // for arguments, should get a helper struct that looks like struct Divergent 78 void dInv(int i, rs_allocation a, int j) { (void)a; } 79 80 // for arguments, should get a helper struct that looks like struct DivergentNest 81 void dnInv(int x, struct Divergent d, int y) { (void)d; } 82