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
2c5c6f38
There was an error fetching the commit references. Please try again later.
Commit
2c5c6f38
authored
7 years ago
by
psychocrypt
Browse files
Options
Downloads
Patches
Plain Diff
add option to disable CPU backend
parent
47a9063e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+11
-2
11 additions, 2 deletions
CMakeLists.txt
backend/BackendConnector.cpp
+7
-5
7 additions, 5 deletions
backend/BackendConnector.cpp
with
18 additions
and
7 deletions
CMakeLists.txt
+
11
−
2
View file @
2c5c6f38
...
...
@@ -43,7 +43,7 @@ option(CMAKE_LINK_STATIC "link as much as possible libraries static" OFF)
#option(CUDA_USE_STATIC_CUDA_RUNTIME "Use the static version of the CUDA runtime library if available" OFF)
#set(CUDA_USE_STATIC_CUDA_RUNTIME OFF CACHE BOOL "Use the static version of the CUDA runtime library if available" FORCE)
option
(
CUDA_ENABLE
"Enable or disable
NVIDIA
CUDA support"
ON
)
option
(
CUDA_ENABLE
"Enable or disable CUDA support
(NVIDIA backend)
"
ON
)
if
(
CUDA_ENABLE
)
find_package
(
CUDA 7.5 QUIET
)
...
...
@@ -155,7 +155,7 @@ list(APPEND CMAKE_PREFIX_PATH "$ENV{CMAKE_PREFIX_PATH}")
# Find OpenCL
###############################################################################
option
(
OpenCL_ENABLE
"Enable or disable
the requirement of hwloc
"
ON
)
option
(
OpenCL_ENABLE
"Enable or disable
OpenCL spport (AMD GPU support)
"
ON
)
if
(
OpenCL_ENABLE
)
find_package
(
OpenCL QUIET
)
if
(
OpenCL_FOUND
)
...
...
@@ -169,6 +169,15 @@ else()
add_definitions
(
"-DCONF_NO_OPENCL"
)
endif
()
###############################################################################
# CPU backend
###############################################################################
option
(
CPU_ENABLE
"Enable or disable CPU support"
ON
)
if
(
NOT CPU_ENABLE
)
add_definitions
(
"-DCONF_NO_CPU"
)
endif
()
################################################################################
# Find PThreads
################################################################################
...
...
This diff is collapsed.
Click to expand it.
backend/BackendConnector.cpp
+
7
−
5
View file @
2c5c6f38
...
...
@@ -62,11 +62,6 @@ std::vector<IBackend*>* BackendConnector::thread_starter(miner_work& pWork)
std
::
vector
<
IBackend
*>*
pvThreads
=
new
std
::
vector
<
IBackend
*>
;
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."
);
#ifndef CONF_NO_CUDA
Plugin
nvidiaPlugin
(
"NVIDIA"
,
"libxmrstak_cuda_backend"
);
std
::
vector
<
IBackend
*>*
nvidiaThreads
=
nvidiaPlugin
.
startBackend
(
static_cast
<
uint32_t
>
(
pvThreads
->
size
()),
pWork
);
...
...
@@ -82,6 +77,13 @@ std::vector<IBackend*>* BackendConnector::thread_starter(miner_work& pWork)
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."
);
#endif
GlobalStates
::
iThreadCount
=
pvThreads
->
size
();
return
pvThreads
;
...
...
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