git-svn-id: svn://db.shs.com.ru/pip@588 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2017-12-24 19:41:18 +00:00
parent 2353b3b33f
commit 485a9d554d
4 changed files with 23 additions and 11 deletions

View File

@@ -371,13 +371,17 @@ endif()
# Check if PIP support OpenCL
find_package(OpenCL QUIET)
if(OpenCL_FOUND)
message(STATUS "Building with OpenCL support")
include_directories(${OpenCL_INCLUDE_DIRS})
message(STATUS "Building with OpenCL support)")
if(APPLE)
include_directories(${OpenCL_INCLUDE_DIRS}/Headers)
else()
include_directories(${OpenCL_INCLUDE_DIRS})
endif()
add_definitions(-DPIP_OPENCL)
pip_resources(CL_RES "src_opencl/resources.conf")
add_library(pip_opencl SHARED ${CPP_LIB_OPENCL} ${CL_RES})
add_dependencies(pip_opencl pip_rc)
target_link_libraries(pip_opencl pip ${OpenCL_LIBRARIES})
target_link_libraries(pip_opencl pip OpenCL::OpenCL)
list(APPEND LIBS_STATUS OpenCL)
list(APPEND PIP_LIBS_TARGETS pip_opencl)
set(OpenCL_FOUND ${OpenCL_LIBRARIES})

View File

@@ -1,6 +1,9 @@
#include "pispi.h"
#include "piincludes_p.h"
#ifndef WINDOWS
#if !defined(WINDOWS) && !defined(MAC_OS)
# define PISPI
#endif
#ifdef PISPI
# include <fcntl.h>
# include <sys/ioctl.h>
# include <linux/spi/spidev.h>
@@ -8,7 +11,7 @@
PRIVATE_DEFINITION_START(PISPI)
#ifndef WINDOWS
#ifdef PISPI
int fd;
spi_ioc_transfer spi_ioc_tr;
#endif
@@ -26,7 +29,7 @@ PISPI::PISPI(const PIString & path, uint speed, PIIODevice::DeviceMode mode) : P
spi_mode = 0;
if (mode == ReadOnly)
piCoutObj << "error, SPI can't work in ReadOnly mode";
#ifndef WINDOWS
#ifdef PISPI
PRIVATE->fd = 0;
#endif
}
@@ -56,7 +59,7 @@ bool PISPI::isParameterSet(PISPI::Parameters parameter) const {
bool PISPI::openDevice() {
#ifndef WINDOWS
#ifdef PISPI
int ret = 0;
//piCoutObj << "open device" << path();
PRIVATE->fd = ::open(path().dataAscii(), O_RDWR);
@@ -83,7 +86,7 @@ bool PISPI::openDevice() {
bool PISPI::closeDevice() {
#ifndef WINDOWS
#ifdef PISPI
if (PRIVATE->fd) ::close(PRIVATE->fd);
#endif
return true;
@@ -99,7 +102,7 @@ int PISPI::readDevice(void * read_to, int max_size) {
int PISPI::writeDevice(const void * data, int max_size) {
#ifndef WINDOWS
#ifdef PISPI
if (max_size > 0) {
if (tx_buf.size_s() != max_size) {
tx_buf.resize(max_size);

View File

@@ -28,8 +28,9 @@
# include <tlhelp32.h>
#endif
#ifdef MAC_OS
# include <sys/proc_info.h>
struct kqueue_id_t;
# include <libproc.h>
# include <sys/proc_info.h>
#endif

View File

@@ -1,5 +1,9 @@
#include "piopencl.h"
#include "CL/cl.h"
#ifdef MAC_OS
# include "cl.h"
#else
# include "CL/cl.h"
#endif
PRIVATE_DEFINITION_START(PIOpenCL::Context)