|
GCVL
Multi-platform (Windows, Unix and Mac OS) C++/OpenCL/CUDA library with several Computer Vision algorithms.
|
00001 /* 00002 * 00003 * GPGPU Computer Vision Library (GCVL) 00004 * 00005 * Copyright (c) Luis Omar Alvarez Mures 2015 <omar.alvarez@udc.es> 00006 * Copyright (c) Emilio Padron Gonzalez 2015 <emilioj@gmail.com> 00007 * 00008 * All rights reserved. 00009 * 00010 * This library is free software; you can redistribute it and/or 00011 * modify it under the terms of the GNU General Public 00012 * License as published by the Free Software Foundation; either 00013 * version 3 of the License, or (at your option) any later version. 00014 * 00015 * This library is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 * General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU General Public 00021 * License along with this library. 00022 * 00023 */ 00024 00025 #pragma once 00026 00027 #include "../export.h" 00028 #include "../gcvlconfig.h" 00029 #include "oclutils.h" 00030 00031 namespace gcvl { namespace opencl { 00032 00033 class GCVL_EXPORT Core { 00034 00035 public: 00036 Core(); 00037 Core(std::string platform, bool locking); 00038 ~Core(); 00040 00043 inline const std::string& getPlatform() { return _platform; } 00045 00048 inline const cl_context& getContext() { return _context; } 00050 00053 inline const cl_device_id& getDevice() { return _device; } 00055 00058 inline const cl_command_queue& getQueue() { return _queue; } 00060 inline const void waitForQueue() { clFinish(_queue); } 00062 inline const void printInfo() { _platforms.Print(); } 00063 00064 private: 00065 OpenCL_platforms_list _platforms; 00066 std::string _platform; 00067 cl_context _context; 00068 cl_device_id _device; 00069 cl_command_queue _queue; 00070 00071 }; 00072 00073 } }