@@ -763,7 +763,7 @@ protected String doInBackground(String... arg0) {
763763 publishProgress ("\n Unfortunately, no scenarios found for your device ..." );
764764 return null ;
765765 }
766-
766+ String localAppPath = AppConfigService . getLocalAppPath () + File . separator + "openscience" + File . separator ;
767767 for (int i = 0 ; i < scenarios .length (); i ++) {
768768 JSONObject scenario = scenarios .getJSONObject (i );
769769 final String module_uoa = scenario .getString ("module_uoa" );
@@ -845,7 +845,6 @@ public void println(String text) {
845845 // copyToAppSpace is not mandatory
846846 }
847847 if (copyToAppSpace != null && copyToAppSpace .equalsIgnoreCase ("yes" )) {
848- String localAppPath = AppConfigService .getLocalAppPath () + File .separator + "openscience" + File .separator ;
849848 String fileAppDir = localAppPath + file .getString ("path" );
850849 File appfp = new File (fileAppDir );
851850 if (!appfp .exists ()) {
@@ -933,13 +932,24 @@ public void println(String text) {
933932 String openCLlibPath = null ;
934933 openCLlibPath = patchOpenCLIfRequired ();
935934
935+ String viennaclCachePath = "" ;
936+
936937 if (openCLlibPath != null ) {
937938 libPath = libPath + ":" + openCLlibPath ;
939+ viennaclCachePath = localAppPath + File .separator + "viennacl_cache" + File .separator ;
940+ File appfp = new File (viennaclCachePath );
941+ if (!appfp .exists ()) {
942+ if (!appfp .mkdirs ()) {
943+ publishProgress ("\n Error creating dir (" + viennaclCachePath + ") ..." );
944+ return null ;
945+ }
946+ }
947+
938948 }
939949 String [] scenarioEnv = {
940950 "CT_REPEAT_MAIN=" + String .valueOf (1 ),
941951 "LD_LIBRARY_PATH=" + libPath + ":$LD_LIBRARY_PATH" ,
942- "VIENNACL_CACHE_PATH=" + DATA_LOCAL_TMP_VIENNACL_CACHE
952+ "VIENNACL_CACHE_PATH=" + viennaclCachePath
943953 };
944954 publishProgress ("Prepared scenario env " + scenarioEnv [0 ]);
945955 publishProgress ("Prepared scenario env " + scenarioEnv [1 ]);
@@ -1016,6 +1026,17 @@ public void run() {
10161026 }
10171027 publishProgress ("\n Recognition result:" + recognitionRawResultText );
10181028
1029+
1030+ if (viennaclCachePath != null && !viennaclCachePath .trim ().equals ("" )) {
1031+ String [] lsCacheResult = openme .openme_run_program ("ls " + viennaclCachePath , null , viennaclCachePath );
1032+ if (!lsCacheResult [1 ].isEmpty ()) {
1033+ publishProgress ("ViennaCL cache generated " + lsCacheResult [1 ]);
1034+ } else {
1035+ publishProgress ("ViennaCL cache not generated" );
1036+ }
1037+ }
1038+
1039+
10191040 publishProgress ("Submitting results and unexpected behavior (if any) to the Collective Knowledge Aggregator ...\n " );
10201041
10211042 if (getCurl () == null ) {
0 commit comments