Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
azure-cloud-mining-script
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Recolic
azure-cloud-mining-script
Commits
1fbd6f6b
There was an error fetching the commit references. Please try again later.
Commit
1fbd6f6b
authored
7 years ago
by
psychocrypt
Browse files
Options
Downloads
Patches
Plain Diff
use runtime enable/disable flag for backends
parent
0938fd98
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
backend/BackendConnector.cpp
+24
-14
24 additions, 14 deletions
backend/BackendConnector.cpp
with
24 additions
and
14 deletions
backend/BackendConnector.cpp
+
24
−
14
View file @
1fbd6f6b
...
...
@@ -45,6 +45,7 @@
#include
"Plugin.hpp"
#include
"../Environment.hpp"
#include
"../console.h"
#include
"../Params.hpp"
namespace
xmrstak
{
...
...
@@ -65,26 +66,35 @@ std::vector<IBackend*>* BackendConnector::thread_starter(miner_work& pWork)
std
::
vector
<
IBackend
*>*
pvThreads
=
new
std
::
vector
<
IBackend
*>
;
#ifndef CONF_NO_CUDA
Plugin
nvidiaPlugin
(
"NVIDIA"
,
"xmrstak_cuda_backend"
);
std
::
vector
<
IBackend
*>*
nvidiaThreads
=
nvidiaPlugin
.
startBackend
(
static_cast
<
uint32_t
>
(
pvThreads
->
size
()),
pWork
,
Environment
::
inst
());
pvThreads
->
insert
(
std
::
end
(
*
pvThreads
),
std
::
begin
(
*
nvidiaThreads
),
std
::
end
(
*
nvidiaThreads
));
if
(
nvidiaThreads
->
size
()
==
0
)
printer
::
inst
()
->
print_msg
(
L0
,
"WARNING: backend NVIDIA disabled."
);
if
(
Params
::
inst
().
useNVIDIA
)
{
Plugin
nvidiaPlugin
(
"NVIDIA"
,
"xmrstak_cuda_backend"
);
std
::
vector
<
IBackend
*>*
nvidiaThreads
=
nvidiaPlugin
.
startBackend
(
static_cast
<
uint32_t
>
(
pvThreads
->
size
()),
pWork
,
Environment
::
inst
());
pvThreads
->
insert
(
std
::
end
(
*
pvThreads
),
std
::
begin
(
*
nvidiaThreads
),
std
::
end
(
*
nvidiaThreads
));
if
(
nvidiaThreads
->
size
()
==
0
)
printer
::
inst
()
->
print_msg
(
L0
,
"WARNING: backend NVIDIA disabled."
);
}
#endif
#ifndef CONF_NO_OPENCL
Plugin
amdPlugin
(
"AMD"
,
"xmrstak_opencl_backend"
);
std
::
vector
<
IBackend
*>*
amdThreads
=
amdPlugin
.
startBackend
(
static_cast
<
uint32_t
>
(
pvThreads
->
size
()),
pWork
,
Environment
::
inst
());
pvThreads
->
insert
(
std
::
end
(
*
pvThreads
),
std
::
begin
(
*
amdThreads
),
std
::
end
(
*
amdThreads
));
if
(
amdThreads
->
size
()
==
0
)
printer
::
inst
()
->
print_msg
(
L0
,
"WARNING: backend AMD disabled."
);
if
(
Params
::
inst
().
useAMD
)
{
Plugin
amdPlugin
(
"AMD"
,
"xmrstak_opencl_backend"
);
std
::
vector
<
IBackend
*>*
amdThreads
=
amdPlugin
.
startBackend
(
static_cast
<
uint32_t
>
(
pvThreads
->
size
()),
pWork
,
Environment
::
inst
());
pvThreads
->
insert
(
std
::
end
(
*
pvThreads
),
std
::
begin
(
*
amdThreads
),
std
::
end
(
*
amdThreads
));
if
(
amdThreads
->
size
()
==
0
)
printer
::
inst
()
->
print_msg
(
L0
,
"WARNING: backend AMD disabled."
);
}
#endif
#ifndef CONF_NO_CPU
auto
cpuThreads
=
cpu
::
minethd
::
thread_starter
(
static_cast
<
uint32_t
>
(
pvThreads
->
size
()),
pWork
);
pvThreads
->
insert
(
std
::
end
(
*
pvThreads
),
std
::
begin
(
cpuThreads
),
std
::
end
(
cpuThreads
));
if
(
cpuThreads
.
size
()
==
0
)
printer
::
inst
()
->
print_msg
(
L0
,
"WARNING: backend CPU disabled."
);
if
(
Params
::
inst
().
useCPU
)
{
auto
cpuThreads
=
cpu
::
minethd
::
thread_starter
(
static_cast
<
uint32_t
>
(
pvThreads
->
size
()),
pWork
);
pvThreads
->
insert
(
std
::
end
(
*
pvThreads
),
std
::
begin
(
cpuThreads
),
std
::
end
(
cpuThreads
));
if
(
cpuThreads
.
size
()
==
0
)
printer
::
inst
()
->
print_msg
(
L0
,
"WARNING: backend CPU disabled."
);
}
#endif
GlobalStates
::
inst
().
iThreadCount
=
pvThreads
->
size
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment