PLSSVM - Parallel Least Squares Support Vector Machine  2.0.0
A Least Squares Support Vector Machine implementation using different backends.
Namespaces | Macros | Functions
utility.hpp File Reference

Utility functions specific to the OpenCL backend. More...

#include "plssvm/backends/OpenCL/detail/command_queue.hpp"
#include "plssvm/backends/OpenCL/detail/context.hpp"
#include "plssvm/backends/OpenCL/detail/error_code.hpp"
#include "plssvm/backends/OpenCL/detail/kernel.hpp"
#include "plssvm/detail/assert.hpp"
#include "plssvm/kernel_function_types.hpp"
#include "plssvm/target_platforms.hpp"
#include "CL/cl.h"
#include "fmt/core.h"
#include <cstddef>
#include <string>
#include <string_view>
#include <utility>
#include <vector>

Go to the source code of this file.

Namespaces

 plssvm
 The main namespace containing all public API functions.
 
 plssvm::opencl
 Namespace containing the C-SVM using the OpenCL backend.
 
 plssvm::opencl::detail
 Namespace containing OpenCL backend specific implementation details. Should not directly be used by users.
 

Macros

#define PLSSVM_OPENCL_ERROR_CHECK(err, ...)   plssvm::opencl::detail::device_assert((err), ##__VA_ARGS__)
 Macro used for error checking OpenCL runtime functions.
 

Functions

void plssvm::opencl::detail::device_assert (error_code code, std::string_view msg="")
 Check the OpenCL error code. If code signals an error, throw a plssvm::opencl::backend_exception. More...
 
std::pair< std::vector< context >, target_platform > plssvm::opencl::detail::get_contexts (target_platform target)
 Returns the context listing all devices matching the target platform target and the actually used target platform (only interesting if the provided target was automatic). More...
 
void plssvm::opencl::detail::device_synchronize (const command_queue &queue)
 Wait for the compute device associated with queue to finish. More...
 
std::string plssvm::opencl::detail::get_device_name (const command_queue &queue)
 Get the name of the device associated with the OpenCL command queue queue. More...
 
std::vector< std::pair< compute_kernel_name, std::string > > plssvm::opencl::detail::kernel_type_to_function_names (kernel_function_type kernel)
 Convert the kernel type kernel to the device function names and return the plssvm::opencl::detail::compute_kernel_name identifier. More...
 
std::vector< command_queue > plssvm::opencl::detail::create_command_queues (const std::vector< context > &contexts, target_platform target, const std::vector< std::pair< compute_kernel_name, std::string >> &kernel_names)
 Create command queues for all devices in the OpenCL contexts with respect to target given and the associated compute kernels with respect to the given source files and kernel function names. Always builds kernels for float and double precision floating point types. More...
 
template<typename... Args>
void plssvm::opencl::detail::set_kernel_args (cl_kernel kernel, Args... args)
 Set all arguments in the parameter pack args for the kernel kernel. More...
 
template<typename... Args>
void plssvm::opencl::detail::run_kernel (const command_queue &queue, cl_kernel kernel, const std::vector< std::size_t > &grid_size, const std::vector< std::size_t > &block_size, Args &&...args)
 Run the 1D kernel on the queue with the additional parameters args. More...
 
template<typename... Args>
void plssvm::opencl::detail::run_kernel (const command_queue &queue, cl_kernel kernel, std::size_t grid_size, std::size_t block_size, Args &&...args)
 Run the 1D kernel on the queue with the additional parameters args. More...
 

Detailed Description

Utility functions specific to the OpenCL backend.

Author
Alexander Van Craen
Marcel Breyer
License
This file is part of the PLSSVM project which is released under the MIT license. See the LICENSE.md file in the project root for full license information.