Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

first version of OpenCL support for operations on rasters (and soon f… #32

Merged
merged 39 commits into from
Oct 12, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
b381cd4
first version of OpenCL support for operations on rasters (and soon f…
michaelmattig Sep 8, 2020
24031cb
add code for remaining raster data types
michaelmattig Sep 9, 2020
5176f98
Add raster info and nodata functions to kernels
michaelmattig Sep 10, 2020
6819e8e
OCL error handling
michaelmattig Sep 10, 2020
b0179ca
use static reference to OpenCl device to circumvent concurrency problems
michaelmattig Sep 10, 2020
3140ad0
first WIP version of Expression operator.
michaelmattig Sep 11, 2020
e3e389b
calculate raster index from 2d work dims
michaelmattig Sep 15, 2020
7edcb11
fix expression kernel
michaelmattig Sep 15, 2020
a301d2e
macro for calling a function on a raster and the corresponding enum v…
michaelmattig Sep 15, 2020
1dc1455
macros and doc
michaelmattig Sep 16, 2020
b95c003
Merge remote-tracking branch 'remotes/origin/master' into ocl
michaelmattig Sep 16, 2020
d50467c
fix lib.rs
michaelmattig Sep 16, 2020
cb0d6b4
towars opencl support for feature collections
michaelmattig Sep 16, 2020
0a848c2
code clean up
michaelmattig Sep 18, 2020
eaa9745
Arrow OpenCL integration WIP
michaelmattig Sep 22, 2020
4e2fc62
Merge remote-tracking branch 'remotes/origin/master' into ocl
michaelmattig Sep 22, 2020
45634bd
projection to spatial reference
michaelmattig Sep 23, 2020
c5ddd14
OpenCL feature collection buffer handling
michaelmattig Sep 23, 2020
bd4ed71
OpenCL feature collection column handling
michaelmattig Sep 24, 2020
76706d1
clean up some todos
michaelmattig Sep 24, 2020
422b1ff
fixed "offsets do not start at zero" bug
michaelmattig Sep 25, 2020
91ef24f
implement suggestions
michaelmattig Oct 1, 2020
f818167
Merge branch 'master' into ocl
michaelmattig Oct 1, 2020
6d007dd
adjust expression operator to master
michaelmattig Oct 1, 2020
bad20b7
merged column names and types together
michaelmattig Oct 2, 2020
9654a39
changed buffer data type to Double2
michaelmattig Oct 2, 2020
b7fb597
clippy
michaelmattig Oct 2, 2020
88017ba
make condition more readable
michaelmattig Oct 2, 2020
0c148c7
add missing methods
michaelmattig Oct 2, 2020
3b07edb
infer vector data type from CollectionType
michaelmattig Oct 2, 2020
72ac38a
get start and end time only once
michaelmattig Oct 2, 2020
39100f0
remove ProQue to avoid hanging test
michaelmattig Oct 2, 2020
1dbd674
clippy
michaelmattig Oct 2, 2020
7ed0dcf
docs
michaelmattig Oct 7, 2020
ec9ee74
renaming
michaelmattig Oct 8, 2020
f67bb46
pass queue explicitly
michaelmattig Oct 9, 2020
d11f857
use i8/char for transferring bool to opencl device
michaelmattig Oct 9, 2020
1f4f5dd
generify conversion of rasters and typed rasters
michaelmattig Oct 9, 2020
3fe3ae0
require nodata value specification for expression output
michaelmattig Oct 9, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 140 additions & 0 deletions datatypes/src/raster/typed_raster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,146 @@ where
}
None
}

pub fn get_u8_ref(&self) -> Option<&BaseRaster<D, u8, Vec<u8>>> {
if let TypedRasterNDim::U8(r) = self {
return Some(r);
}
None
}

pub fn get_u16_ref(&self) -> Option<&BaseRaster<D, u16, Vec<u16>>> {
if let TypedRasterNDim::U16(r) = self {
return Some(r);
}
None
}

pub fn get_u32_ref(&self) -> Option<&BaseRaster<D, u32, Vec<u32>>> {
if let TypedRasterNDim::U32(r) = self {
return Some(r);
}
None
}

pub fn get_u64_ref(&self) -> Option<&BaseRaster<D, u64, Vec<u64>>> {
if let TypedRasterNDim::U64(r) = self {
return Some(r);
}
None
}

pub fn get_i8_ref(&self) -> Option<&BaseRaster<D, i8, Vec<i8>>> {
if let TypedRasterNDim::I8(r) = self {
return Some(r);
}
None
}

pub fn get_i16_ref(&self) -> Option<&BaseRaster<D, i16, Vec<i16>>> {
if let TypedRasterNDim::I16(r) = self {
return Some(r);
}
None
}

pub fn get_i32_ref(&self) -> Option<&BaseRaster<D, i32, Vec<i32>>> {
if let TypedRasterNDim::I32(r) = self {
return Some(r);
}
None
}

pub fn get_i64_ref(&self) -> Option<&BaseRaster<D, i64, Vec<i64>>> {
jdroenner marked this conversation as resolved.
Show resolved Hide resolved
if let TypedRasterNDim::I64(r) = self {
return Some(r);
}
None
}

pub fn get_f32_ref(&self) -> Option<&BaseRaster<D, f32, Vec<f32>>> {
if let TypedRasterNDim::F32(r) = self {
return Some(r);
}
None
}

pub fn get_f64_ref(&self) -> Option<&BaseRaster<D, f64, Vec<f64>>> {
if let TypedRasterNDim::F64(r) = self {
return Some(r);
}
None
}

pub fn get_u8_ref_mut(&mut self) -> Option<&mut BaseRaster<D, u8, Vec<u8>>> {
if let TypedRasterNDim::U8(r) = self {
return Some(r);
}
None
}

pub fn get_u16_ref_mut(&mut self) -> Option<&mut BaseRaster<D, u16, Vec<u16>>> {
if let TypedRasterNDim::U16(r) = self {
return Some(r);
}
None
}

pub fn get_u32_ref_mut(&mut self) -> Option<&mut BaseRaster<D, u32, Vec<u32>>> {
if let TypedRasterNDim::U32(r) = self {
return Some(r);
}
None
}

pub fn get_u64_ref_mut(&mut self) -> Option<&mut BaseRaster<D, u64, Vec<u64>>> {
if let TypedRasterNDim::U64(r) = self {
return Some(r);
}
None
}

pub fn get_i8_ref_mut(&mut self) -> Option<&mut BaseRaster<D, i8, Vec<i8>>> {
if let TypedRasterNDim::I8(r) = self {
return Some(r);
}
None
}

pub fn get_i16_ref_mut(&mut self) -> Option<&mut BaseRaster<D, i16, Vec<i16>>> {
if let TypedRasterNDim::I16(r) = self {
return Some(r);
}
None
}

pub fn get_i32_ref_mut(&mut self) -> Option<&mut BaseRaster<D, i32, Vec<i32>>> {
if let TypedRasterNDim::I32(r) = self {
return Some(r);
}
None
}

pub fn get_i64_ref_mut(&mut self) -> Option<&mut BaseRaster<D, i64, Vec<i64>>> {
if let TypedRasterNDim::I64(r) = self {
return Some(r);
}
None
}

pub fn get_f32_ref_mut(&mut self) -> Option<&mut BaseRaster<D, f32, Vec<f32>>> {
if let TypedRasterNDim::F32(r) = self {
return Some(r);
}
None
}

pub fn get_f64_ref_mut(&mut self) -> Option<&mut BaseRaster<D, f64, Vec<f64>>> {
if let TypedRasterNDim::F64(r) = self {
return Some(r);
}
None
}
}

// TODO: use a macro?
Expand Down
8 changes: 8 additions & 0 deletions operators/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ pub enum Error {
SerdeJson {
source: serde_json::Error,
},
OCL {
#[snafu(source(from(ocl::error::Error, failure::Fail::compat)))]
source: failure::Compat<ocl::error::Error>,
ChristianBeilschmidt marked this conversation as resolved.
Show resolved Hide resolved
},
CLProgramInvalidRasterIndex,
CLProgramInvalidRasterDataType,
CLProgramUnspecifiedRaster,
CLInvalidInputsForIterationType,
}

impl From<geoengine_datatypes::error::Error> for Error {
Expand Down
1 change: 1 addition & 0 deletions operators/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@
pub mod engine;
pub mod error;
pub mod mock;
pub mod opencl;
pub mod source;
pub mod util;
Loading