simplify templates

This commit is contained in:
psychocrypt
2017-09-30 23:46:08 +02:00
parent 2c5c6f382a
commit 87357352c9
7 changed files with 12 additions and 10 deletions
-2
View File
@@ -80,7 +80,6 @@ private:
configTpl.set( std::string(tpl) );
std::string conf;
conf += std::string("\"gpu_threads_conf\" :\n[\n");
int i = 0;
for(auto& ctx : devVec)
{
@@ -97,7 +96,6 @@ private:
" },\n";
++i;
}
conf += std::string("],\n\n");
configTpl.replace("PLATFORMINDEX",std::to_string(platformIndex));
configTpl.replace("NUMGPUS",std::to_string(devVec.size()));
+6 -1
View File
@@ -11,10 +11,15 @@ R"===(
* intensity - Number of parallel GPU threads (nothing to do with CPU threads)
* worksize - Number of local GPU threads (nothing to do with CPU threads)
* affine_to_cpu - This will affine the thread to a CPU. This can make a GPU miner play along nicer with a CPU miner.
* "gpu_threads_conf" :
* [
* { "index" : 0, "intensity" : 1000, "worksize" : 8, "affine_to_cpu" : false },
* ],
*/
"gpu_threads_conf" : [
GPUCONFIG
],
/*
* Platform index. This will be 0 unless you have different OpenCL platform - eg. AMD and Intel.
-3
View File
@@ -44,7 +44,6 @@ public:
configTpl.set( std::string(tpl) );
std::string conf;
conf += std::string("\"cpu_threads_conf\" :\n[\n");
if(!detectL3Size() || L3KB_size < 1024 || L3KB_size > 102400)
{
@@ -96,8 +95,6 @@ public:
}
}
conf += std::string("],\n\n");
configTpl.replace("CPUCONFIG",conf);
configTpl.write("cpu.txt");
printer::inst()->print_msg(L0, "CPU configuration stored in file '%s'", "cpu.txt");
-2
View File
@@ -42,7 +42,6 @@ public:
;
configTpl.set( std::string(tpl) );
conf += std::string("\"cpu_threads_conf\" :\n[\n");
try
{
std::vector<hwloc_obj_t> tlcs;
@@ -73,7 +72,6 @@ public:
conf += std::string(" { \"low_power_mode\" : false, \"no_prefetch\" : true, \"affine_to_cpu\" : false },\n");
printer::inst()->print_msg(L0, "Autoconf FAILED: %s. Create config for a single thread.", err.what());
}
conf += std::string("],\n\n");
configTpl.replace("CPUCONFIG",conf);
configTpl.write("cpu.txt");
+3
View File
@@ -24,7 +24,10 @@ R"===(
* ],
*/
"cpu_threads_conf" :
[
CPUCONFIG
],
/*
* LARGE PAGE SUPPORT
-2
View File
@@ -86,7 +86,6 @@ private:
configTpl.set( std::string(tpl) );
std::string conf;
conf += std::string("\"gpu_threads_conf\" :\n[\n");
int i = 0;
for(auto& ctx : nvidCtxVec)
{
@@ -98,7 +97,6 @@ private:
" },\n";
++i;
}
conf += std::string("],\n\n");
configTpl.replace("GPUCONFIG",conf);
configTpl.write("nvidia.txt");
+3
View File
@@ -20,6 +20,9 @@ R"===(
* ],
*/
"gpu_threads_conf" :
[
GPUCONFIG
],
)==="