MorphoGraphX  2.0-1-227
CudaExport.hpp
Go to the documentation of this file.
1 //
2 // This file is part of MorphoGraphX - http://www.MorphoGraphX.org
3 // Copyright (C) 2012-2015 Richard S. Smith and collaborators.
4 //
5 // If you use MorphoGraphX in your work, please cite:
6 // http://dx.doi.org/10.7554/eLife.05864
7 //
8 // MorphoGraphX is free software, and is licensed under under the terms of the
9 // GNU General (GPL) Public License version 2.0, http://www.gnu.org/licenses.
10 //
11 #ifndef CUDA_EXPORT_HPP
12 #define CUDA_EXPORT_HPP
13 
14 #include <Config.hpp>
15 #include <cuda/CudaGlobal.hpp>
16 #include <Geometry.hpp>
17 #include <thrust/host_vector.h>
18 
19 namespace mgx
20 {
21  // Define host_vector types used by MorphoGraphX
22  typedef thrust::host_vector<uint> HVecU;
23  typedef thrust::host_vector<ushort> HVecUS;
24  typedef thrust::host_vector<float> HVecF;
25  typedef thrust::host_vector<Point3u> HVec3U;
26  typedef thrust::host_vector<Point3f> HVec3F;
27  typedef thrust::host_vector<Point4f> HVec4F;
28 
29  cuda_EXPORT int initGPU();
30  cuda_EXPORT int setHoldMemGPU(uint holdmem);
31  cuda_EXPORT void freeMem();
32  cuda_EXPORT void holdMem();
33  cuda_EXPORT void memAvail();
34 
35  cuda_EXPORT int averageGPU(const Point3i &imgSize, const Point3i &radius,
36  const HVecUS &srcdata, HVecUS &dstdata);
37  cuda_EXPORT int medianGPU(const Point3i &imgSize, const Point3i &radius,
38  const HVecUS &srcdata, HVecUS &dstdata);
39  cuda_EXPORT int medianOfMediansGPU(const Point3i &imgSize, const Point3i &radius,
40  const HVecUS &srcdata, HVecUS &dstdata);
41  cuda_EXPORT int dilateGPU(const Point3i &imgSize, const Point3i &radius, bool roundNhbd,
42  const HVecUS &srcdata, HVecUS &dstdata);
43  cuda_EXPORT int erodeGPU(const Point3i &imgSize, const Point3i &radius, bool byLabel, bool roundNhbd,
44  const HVecUS &srcdata, HVecUS &dstdata);
45  cuda_EXPORT int gaussianBlurGPU(const Point3i &imgSize, const Point3f &imgStep,
46  const Point3f &sigma, const HVecUS &srcdata, HVecUS &dstdata);
47  cuda_EXPORT int sharpenGPU(const Point3i &imgSize, const Point3f &imgStep,
48  const Point3f &sigma, const float amount, const HVecUS &srcdata, HVecUS &dstdata);
49  cuda_EXPORT int applyKernelGPU(const Point3i &imgSize, const HVecF &kernelX,
50  const HVecF &kernelY, const HVecF &kernelZ,
51  const HVecUS &srcdata, HVecUS &dstdata);
52  cuda_EXPORT int colorGradGPU(const Point3i &imgSize, float div, const HVecUS &srcdata,
53  HVecUS &dstdata);
54  cuda_EXPORT int edgeDetectGPU(const Point3i &imgSize, ushort lowthresh, ushort highthresh,
55  float mult, ushort fillval, const HVecUS &srcdata, HVecUS &dstdata);
56  cuda_EXPORT int insideMeshGPU(const Point3i &base, const Point3i &size,
57  const Point3f &step, const Point3f &shift, const HVec3F &pts,
58  const HVec3U &tris, const HVec3F &nrmls, HVecUS &dstdata);
59  cuda_EXPORT int nearMeshGPU(const Point3i &base, const Point3i &size,
60  const Point3f &step, const Point3f &shift, const HVec3F &pts,
61  const HVec3F &nrmls, float minDist, float maxDist, HVecUS &dstdata);
62  cuda_EXPORT int clipStackGPU(const Point3i &imgSize, const Point3f &step,
63  const Point3f &shift, const Point3u &clipDo, HVec4F &pn,
64  const HVecUS &srcdata, HVecUS &dstdata);
65  cuda_EXPORT int voxelEditGPU(const Point3i &base, const Point3i &size,
66  const Point3i &imgSize, const Point3f &step, const Point3f &shift,
67  const Point3f &p, const Point3f &pz, float radius, ushort color,
68  const Point3u &clipDo, const HVec4F &pn, HVecUS &data);
69 }
70 #endif
mgx::holdMem
void holdMem()
mgx::averageGPU
cuda_EXPORT int averageGPU(const Point3i &imgSize, const Point3i &radius, const HVecUS &srcdata, HVecUS &dstdata)
mgx::uint
unsigned int uint
Definition: Geometry.hpp:41
mgx::HVecU
thrust::host_vector< uint > HVecU
Definition: CudaExport.hpp:22
mgx::freeMem
void freeMem()
mgx::medianGPU
cuda_EXPORT int medianGPU(const Point3i &imgSize, const Point3i &radius, const HVecUS &srcdata, HVecUS &dstdata)
mgx::applyKernelGPU
cuda_EXPORT int applyKernelGPU(const Point3i &imgSize, const HVecF &kernelX, const HVecF &kernelY, const HVecF &kernelZ, const HVecUS &srcdata, HVecUS &dstdata)
mgx::sharpenGPU
cuda_EXPORT int sharpenGPU(const Point3i &imgSize, const Point3f &imgStep, const Point3f &sigma, const float amount, const HVecUS &srcdata, HVecUS &dstdata)
mgx::HVecUS
thrust::host_vector< ushort > HVecUS
Definition: CudaExport.hpp:23
mgx::ushort
unsigned short ushort
Simpler names for the various containers and iterators.
Definition: Geometry.hpp:42
mgx::edgeDetectGPU
cuda_EXPORT int edgeDetectGPU(const Point3i &imgSize, ushort lowthresh, ushort highthresh, float mult, ushort fillval, const HVecUS &srcdata, HVecUS &dstdata)
mgx::HVecF
thrust::host_vector< float > HVecF
Definition: CudaExport.hpp:24
mgx::erodeGPU
cuda_EXPORT int erodeGPU(const Point3i &imgSize, const Point3i &radius, bool byLabel, bool roundNhbd, const HVecUS &srcdata, HVecUS &dstdata)
Geometry.hpp
mgx::HVec3F
thrust::host_vector< Point3f > HVec3F
Definition: CudaExport.hpp:26
mgx::setHoldMemGPU
cuda_EXPORT int setHoldMemGPU(uint holdmem)
mgx
Distributed matrix library.
Definition: Assert.hpp:26
mgx::nearMeshGPU
cuda_EXPORT int nearMeshGPU(const Point3i &base, const Point3i &size, const Point3f &step, const Point3f &shift, const HVec3F &pts, const HVec3F &nrmls, float minDist, float maxDist, HVecUS &dstdata)
mgx::dilateGPU
cuda_EXPORT int dilateGPU(const Point3i &imgSize, const Point3i &radius, bool roundNhbd, const HVecUS &srcdata, HVecUS &dstdata)
mgx::initGPU
cuda_EXPORT int initGPU()
CudaGlobal.hpp
mgx::voxelEditGPU
cuda_EXPORT int voxelEditGPU(const Point3i &base, const Point3i &size, const Point3i &imgSize, const Point3f &step, const Point3f &shift, const Point3f &p, const Point3f &pz, float radius, ushort color, const Point3u &clipDo, const HVec4F &pn, HVecUS &data)
mgx::colorGradGPU
cuda_EXPORT int colorGradGPU(const Point3i &imgSize, float div, const HVecUS &srcdata, HVecUS &dstdata)
mgx::gaussianBlurGPU
cuda_EXPORT int gaussianBlurGPU(const Point3i &imgSize, const Point3f &imgStep, const Point3f &sigma, const HVecUS &srcdata, HVecUS &dstdata)
mgx::memAvail
cuda_EXPORT void memAvail()
mgx::HVec4F
thrust::host_vector< Point4f > HVec4F
Definition: CudaExport.hpp:27
mgx::insideMeshGPU
cuda_EXPORT int insideMeshGPU(const Point3i &base, const Point3i &size, const Point3f &step, const Point3f &shift, const HVec3F &pts, const HVec3U &tris, const HVec3F &nrmls, HVecUS &dstdata)
mgx::Vector< 3, int >
cuda_EXPORT
#define cuda_EXPORT
Definition: CudaGlobal.hpp:40
mgx::medianOfMediansGPU
cuda_EXPORT int medianOfMediansGPU(const Point3i &imgSize, const Point3i &radius, const HVecUS &srcdata, HVecUS &dstdata)
mgx::HVec3U
thrust::host_vector< Point3u > HVec3U
Definition: CudaExport.hpp:25
mgx::clipStackGPU
cuda_EXPORT int clipStackGPU(const Point3i &imgSize, const Point3f &step, const Point3f &shift, const Point3u &clipDo, HVec4F &pn, const HVecUS &srcdata, HVecUS &dstdata)