[asl] 93/177: Fixing hardware selection issue
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Thu Aug 27 09:22:44 UTC 2015
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch master
in repository asl.
commit fbf8afb4095a14b6e6eb47ae7875b86b72166a73
Author: Avtech Scientific <AvtechScientific at users.noreply.github.com>
Date: Tue Jul 14 00:10:14 2015 +0300
Fixing hardware selection issue
---
README.md | 6 +++---
src/acl/aclHardware.cxx | 9 ++++++---
src/acl/aclHardware.h | 6 +++---
src/utilities/aslParametersManager.cxx | 8 ++++----
4 files changed, 16 insertions(+), 13 deletions(-)
diff --git a/README.md b/README.md
index 42c238d..d35f15b 100644
--- a/README.md
+++ b/README.md
@@ -21,8 +21,8 @@ ASL is distributed under the free GNU Affero General Public License (AGPLv3) wit
- [C++ bindings for OpenCL](https://www.khronos.org/registry/cl/api/1.1/cl.hpp) (OpenCL Specification License)
- [boost](http://www.boost.org) (Boost Software License)
- [VTK](http://vtk.org) (BSD License)
- - [optional](https://github.com/AvtechScientific/ASL/blob/master/cmake/ASLBuildOptions.cmake#L3): Matlab support - [matio](https://sourceforge.net/projects/matio) (BSD License)
- - [optional](https://github.com/AvtechScientific/ASL/blob/master/cmake/ASLBuildOptions.cmake#L4): API documentation - [doxygen](http://doxygen.org) (preferably with [graphviz](http://www.graphviz.org))
+ - [optional](https://github.com/AvtechScientific/ASL/blob/master/cmake/ASLBuildOptions.cmake#L3): Matlab support with [matio](https://sourceforge.net/projects/matio) (BSD License)
+ - [optional](https://github.com/AvtechScientific/ASL/blob/master/cmake/ASLBuildOptions.cmake#L4): API documentation with [doxygen](http://doxygen.org) (preferably with [graphviz](http://www.graphviz.org))
2. Download and extract the [ASL source code archive](https://github.com/AvtechScientific/ASL/releases/latest).
3. Create a build directory: `mkdir build-asl; cd build-asl`
4. Use [cmake generator](http://www.cmake.org/cmake/help/v3.2/manual/cmake-generators.7.html) to produce Makefiles: `cmake -G "Unix Makefiles" ../ASL` or project files for your IDE (Visual Studio, Xcode, Eclipse, etc.): `cmake -G "Visual Studio 10" ../ASL`
@@ -42,7 +42,7 @@ ASL is distributed under the free GNU Affero General Public License (AGPLv3) wit
- `pkg-config`: launch ``c++ `pkg-config --cflags --libs ASL` -o locomotive_in_tunnel locomotive_in_tunnel.cc``
- `cmake`: write a basic `CMakeLists.txt` file:
-```CMakeLists.txt
+```cmake
project(locomotive)
cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)
find_package(ASL 0.1.4 CONFIG REQUIRED)
diff --git a/src/acl/aclHardware.cxx b/src/acl/aclHardware.cxx
index 36a6697..86d3131 100644
--- a/src/acl/aclHardware.cxx
+++ b/src/acl/aclHardware.cxx
@@ -104,12 +104,12 @@ namespace acl
(device == getDeviceName(queues[i])))
{
// Choose requested device on requested platform
- defaultQueue = queues.back();
+ defaultQueue = queues[i];
}
}
// Warn if requested combination of platform and device was not found
- if (defaultQueue.get() == 0)
+ if (defaultQueue == NULL)
{
// Choose first available device
defaultQueue = queues.front();
@@ -144,16 +144,19 @@ namespace acl
return getDevice(queue).getInfo<CL_DEVICE_NAME>();
}
+
cl_device_type getDeviceType(const CommandQueue & queue)
{
return getDevice(queue).getInfo<CL_DEVICE_TYPE>();
}
-
+
+
cl_uint getNComputeUnits(const CommandQueue & queue)
{
return getDevice(queue).getInfo<CL_DEVICE_MAX_COMPUTE_UNITS>();
}
+
cl::Device getDevice(const CommandQueue & queue)
{
return queue->getInfo<CL_QUEUE_DEVICE>();
diff --git a/src/acl/aclHardware.h b/src/acl/aclHardware.h
index 79732b6..3f0361a 100644
--- a/src/acl/aclHardware.h
+++ b/src/acl/aclHardware.h
@@ -116,8 +116,8 @@ namespace acl
/**
- Returns the minimum amount of private memory, in bytes, used by each work-
- item in the kernel. This value may include any private memory needed by
+ Returns the minimum amount of private memory, in bytes, used by each work-item
+ in the kernel. This value may include any private memory needed by
an implementation to execute the kernel, including that used by the language
built-ins and variable declared inside the kernel with the __private qualifier.
@@ -138,7 +138,7 @@ namespace acl
/// identified by \p platform and \p device.
/// Warns if requested combination is not found.
void setDefaultQueue(const std::string & platform = "",
- const std::string & device = "");
+ const std::string & device = "");
std::vector<CommandQueue> queues;
CommandQueue defaultQueue;
std::string getDevicesInfo();
diff --git a/src/utilities/aslParametersManager.cxx b/src/utilities/aslParametersManager.cxx
index 999a79e..b25658c 100644
--- a/src/utilities/aslParametersManager.cxx
+++ b/src/utilities/aslParametersManager.cxx
@@ -458,8 +458,8 @@ namespace asl
if (is_directory(p))
{
// Only warn, since all options might have default values, or required values
- // provided through the command line - so no configuration file is required
- warningMessage("ApplicationParametersManager::load() - no parameters file provided, " + p.string() + " is a directory. Using default values");
+ // provided through the command line - so no parameters file is required
+ warningMessage("ApplicationParametersManager::load() - no parameters file provided, " + p.string() + " is a directory. Using default and/or command line values");
}
else
{
@@ -473,7 +473,7 @@ namespace asl
}
else
{
- warningMessage("ApplicationParametersManager::load() - can not open configuration file: " + p.string() + " . Using default values");
+ warningMessage("ApplicationParametersManager::load() - can not open parameters file: " + p.string() + " . Using default and/or command line values");
// Get directory, cutting file name, after using p for warning
p = p.parent_path();
}
@@ -481,7 +481,7 @@ namespace asl
}
else
{
- warningMessage("ApplicationParametersManager::load() - no parameters file provided. Using default values");
+ warningMessage("ApplicationParametersManager::load() - no parameters file provided. Using default and/or command line values");
}
// Generate `parametersFileDirectory`
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/asl.git
More information about the debian-science-commits
mailing list