summaryrefslogtreecommitdiff
path: root/utests/utest_helper.cpp
diff options
context:
space:
mode:
authorYang Rong <rong.r.yang@intel.com>2015-11-04 14:15:30 +0800
committerYang Rong <rong.r.yang@intel.com>2016-05-27 10:10:23 +0800
commit114c1064aae7047032a61ed175fad9926039fa85 (patch)
tree3313c75a01464c7c923030ca4ed330f79e1ed54e /utests/utest_helper.cpp
parentdf196c97b2fd770d9038c520205553d3741590ba (diff)
downloadbeignet-114c1064aae7047032a61ed175fad9926039fa85.tar.gz
Android: change the saved file path.
Save tmp file to /data/local/tmp and the ustest image to /sdcard/ocl Signed-off-by: Yang Rong <rong.r.yang@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@intel.com>
Diffstat (limited to 'utests/utest_helper.cpp')
-rw-r--r--utests/utest_helper.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/utests/utest_helper.cpp b/utests/utest_helper.cpp
index 01feb592..76993d5e 100644
--- a/utests/utest_helper.cpp
+++ b/utests/utest_helper.cpp
@@ -697,7 +697,15 @@ void cl_write_bmp(const int *data, int width, int height, const char *filename)
{
int x, y;
- FILE *fp = fopen(filename, "wb");
+ FILE *fp = NULL;
+#if defined(__ANDROID__)
+ char dst_img[256];
+ snprintf(dst_img, sizeof(dst_img), "/sdcard/ocl/%s", filename);
+ fp = fopen(dst_img, "wb");
+ if(fp == NULL) return;
+#else
+ fp = fopen(filename, "wb");
+#endif
assert(fp);
char *raw = (char *) malloc(width * height * sizeof(int)); // at most