Home | History | Annotate | Download | only in librscpptest
      1 #pragma version(1)
      2 #pragma rs java_package_name(android.rscpp.cts)
      3 #pragma rs_fp_relaxed
      4 
      5 int memset_toValue = 0;
      6 
      7 int compare_value = 0;
      8 int compare_failure = 2;
      9 int failure_value = 0;
     10 
     11 uint32_t dimX = 0;
     12 uint32_t dimY = 0;
     13 rs_allocation array;
     14 
     15 void memset(int *aout) {
     16     *aout = memset_toValue;
     17     return;
     18 }
     19 
     20 void compare(const int *ain) {
     21     if (*ain != compare_value) {
     22         rsAtomicCas(&compare_failure, 2, -1);
     23         failure_value = *ain;
     24     }
     25     return;
     26 }
     27 
     28 void getCompareResult(int* aout) {
     29     *aout = compare_failure;
     30 }
     31 
     32 void setLargeArray(const int *ain, uint32_t x) {
     33     int source = 10;
     34     if (x == 0) {
     35         for (uint32_t i = 0; i < dimX; i++) {
     36             rsSetElementAt(array, &source, i);
     37         }
     38     }
     39 }
     40 
     41 void setLargeArray2D(const int *ain, uint32_t x) {
     42     int source = 10;
     43     if (x == 0) {
     44         for (uint32_t y = 0; y < dimY; y++) {
     45             for (uint32_t xtemp = 0; xtemp < dimX; xtemp++) {
     46                 rsSetElementAt(array, &source, xtemp, y);
     47             }
     48         }
     49     }
     50 }
     51