Skip to content

Commit 5976a0a

Browse files
author
defremov
committed
Add ViennaCL cache support #82
1 parent bd448b5 commit 5976a0a

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

app/src/main/java/openscience/crowdsource/video/experiments/AppConfigService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
//todo it's better to implement all services using IoC
2828
public class AppConfigService {
2929

30-
public static final String DATA_LOCAL_TMP_VIENNACL_CACHE = "/data/local/tmp/viennacl_cache_";
30+
public static final String DATA_LOCAL_TMP_VIENNACL_CACHE = "/data/local/tmp/viennacl_cache/";
3131
private final static String APP_CONFIG_DIR = "/sdcard/openscience/"; //todo get log dir from common config service
3232
private final static String APP_CONFIG_FILE_PATH = APP_CONFIG_DIR + "app_config.json";
3333

app/src/main/java/openscience/crowdsource/video/experiments/MainActivity.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,13 +933,17 @@ public void println(String text) {
933933
String openCLlibPath = null;
934934
openCLlibPath = patchOpenCLIfRequired();
935935

936+
String viennaclCachePath = "";
937+
936938
if (openCLlibPath != null) {
937939
libPath = libPath + ":" + openCLlibPath;
940+
viennaclCachePath = AppConfigService.getLocalAppPath() + File.separator + "openscience" + File.separator + "viennacl_cache"+ File.separator;
941+
938942
}
939943
String[] scenarioEnv = {
940944
"CT_REPEAT_MAIN=" + String.valueOf(1),
941945
"LD_LIBRARY_PATH=" + libPath + ":$LD_LIBRARY_PATH",
942-
"VIENNACL_CACHE_PATH=" + DATA_LOCAL_TMP_VIENNACL_CACHE
946+
"VIENNACL_CACHE_PATH=" + viennaclCachePath
943947
};
944948
publishProgress("Prepared scenario env " + scenarioEnv[0]);
945949
publishProgress("Prepared scenario env " + scenarioEnv[1]);
@@ -1016,6 +1020,16 @@ public void run() {
10161020
}
10171021
publishProgress("\nRecognition result:" + recognitionRawResultText);
10181022

1023+
1024+
1025+
String[] lsCacheResult = openme.openme_run_program("ls " + viennaclCachePath, null, viennaclCachePath);
1026+
if (!lsCacheResult [0].isEmpty()) {
1027+
publishProgress(" * ViennaCL cache dir " + lsCacheResult[0]);
1028+
} else {
1029+
publishProgress("ViennaCL cache dir not inited ");
1030+
}
1031+
1032+
10191033
publishProgress("Submitting results and unexpected behavior (if any) to the Collective Knowledge Aggregator ...\n");
10201034

10211035
if (getCurl() == null) {

0 commit comments

Comments
 (0)