- Fix odd naming conflict between (
ocl-)corealiases andthiserror.
- Add DirectX D3D11 Interop.
- Specify a fixed
thiserrordependency version. - Various fixes and formatting.
- Migrate from failure to thiserror
- Update edition (needs further update now :).
- Fix warnings and Github security alerts.
- Add
OpenClVersion::to_rawmethod which returns the version as a tuple. - Derive
HashforPlatformandDevice.
- No longer assign null kernel values when creating kernel which caused
CL_INVALID_ARG_VALUEerrors on some platforms (#126).
- (ocl-core) Implement the
compile_programandlink_programfunctions.
- Fix a buffer length assertion used during buffer creation.
- Correctly disable kernel argument checking when
KernelBuilder::disable_arg_type_checkis called. - (ocl-extras) Add the
FullDeviceInfotrait, allowing a more convenient method of accessing less frequently used device information types which don't have methods on Device already. - (cl-sys) Change
CL_BUILD_...const types to signed integers.
- Allow owned buffers and images to be passed to
KernelBuilder(andKernel) argument-setting methods such as::arg. Doing so removes any lifetime constraints onKernelBuilderallowing it to be cloned and moved without regard to the lifetime of a buffer or image. Passing buffer or image references will continue to use lifetimes and is negligibly more efficient.
- Revert change made in #114
which broke the ability to declare local kernel arguments via the
KernelBuilder.- Add a test for local kernel arguments.
- Clean up returned error types.
- Add raw info functions for devices (
ocl::Device::info_rawandocl-core::get_device_info_raw). These can be used to query device information provided by non-standard OpenCL extensions.
Kernel has received a much-needed makeover. Creating a kernel is not
exactly like creating other types of objects due to the fact that kernel
arguments are normally specified after actual kernel creation. Because of
this, the old design became a quirky mix of builder-style and normal methods
intended to be as versatile as possible.
To further complicate matters, the issue of if and when Kernel could be
cloned and/or sent between threads was an unsolved problem, potentially
allowing unsafety (race conditions) to occur when setting arguments from
multiple threads.
The original design has been thrown out and a new streamlined design has been adopted. Many rough spots have been smoothed out and potential invalid uses have been eliminated.
KernelBuilderhas been added. All kernels must now be created using a builder.KernelBuilder::arg,KernelBuilder::arg_named, andKernel::set_arghave been been added in order to streamline setting arguments. Each of the new methods will all automatically detect whether aBuffer,Image, scalar, or vector value is being passed. (Type annotation is required whenNoneis passed).Kernel::set_argwill accept either a name (&'static str) or numeric index. If passing a name, the argument must have been declared usingKernelBuilder::arg_named.
ProQue::buffer_builderhas been added and can be used to obtain aBufferBuilderwith pre-configured length and default queue.ProQue::kernel_builderhas also been added (see below).ProgramBuilder::binariesandProgram::with_binaryhave been added.- The new
KernelErrortype has been added.
-
Kernelhas been completely redesigned:Kernel::newhas been removed. Create a kernel withKernel::builderorKernelBuilder::new.- All setup parameters such as the kernel name, program, work sizes, and
arguments are now configured using the builder. All of the methods
associated with construction have been removed from
Kernel. - Most
arg_...andarg_..._namedmethods have been deprecated in favor of::argorarg_named. - Where before,
::arg_scl_namedandarg_vec_namedacceptedNonevalues, now scalar and vector values set using::arg_namedare not optional. Use zero instead (e.g..arg_scl_named::<i32>("rnd", None)-->arg_named("rnd", 0i32)). Kernelno longer implementsClone. Instead, theKernelBuildercan be cloned or re-used (and sent between threads) to create multiple identical or near-identical kernels.::gwo,::gws, and::lwshave been deprecated and should be replaced by::global_work_offset,::global_work_size, and::local_work_sizerespectively.- Most
set_arg_***_namedmethods have been deprecated in favor of::set_arg.
-
KernelCmd::gwo,::gws, and::lwshave been deprecated and should be replaced by::global_work_offset,::global_work_size, and::local_work_sizerespectively. -
ProQue::buildernow has a lifetime. -
ProQue::create_kernelhas been removed and replaced withProQue::kernel_builderwhich can be used to return a newKernelBuilderwith pre-configured name, program, default queue, and global work size. -
Buffer::newandImage::neware now unsafe. -
BufferBuilder::host_dataandImageBuilder::host_datahave been removed. Use::copy_host_sliceor::use_host_sliceinstead. -
ProgramBuilderis now non-consuming and has a lifetime. -
ProgramBuilder::ilnow accepts a slice instead of aVec. -
Program::newhas been renamed toProgram::with_source. Source strings and compiler options are now passed as slices. -
Program::with_ilnow accepts intermediate language byte source and compiler options as slices. -
(ocl-core)
KernelArghas been removed and replaced withArgVal. Conversion is relatively straightforward, enum variants map to 'constructor' methods. Where before you may have created aKernelArgusingKernelArg::Mem(&mem), you will now create anArgValwithArgVal::mem(&mem). Scalar and vector types must now be specified as references:KernelArg::Scalar(10.0f32)-->ArgVal::scalar(&10.0f32). -
(ocl-core)
set_kernel_arghas had its argument type changed to the newArgValtype. AsArgValhas no associated type,set_kernel_argno longer has a type parameter.- Example:
let kernel = core::create_kernel(&program, "multiply")?; core::set_kernel_arg(&kernel, 0, ArgVal::scalar(&10.0f32))?; core::set_kernel_arg(&kernel, 1, ArgVal::mem(&buffer))?;
- Example:
- Replace uses of
ProQue::create_kernelwith::kernel_builder(example regex:ProQue::create_kernel\(([^\)]+)\)-->ProQue::kernel_builder(\1)). - Replace uses of
Kernel::newwithKernel::builder,::name, and::program(example regex:Kernel::new\(([^,]+, [^\)]+)\)-->Kernel::builder().name(\1).program(\2)). - Add
.build()to the end of the list of kernel builder parameters. - Move error handling (
?) to the end, after.build(). - Rename various deprecated
::arg...methods.
Other things to check:
- If
Nonewas being passed to::arg_scl_namedor::arg_vec_named, replace with a zero (e.g..arg_scl_named::<i32>("rnd", None)-->arg_named("rnd", &0i32)). - If you were previously cloning the kernel, you will now instead need to use
the
KernelBuilderto create multiple copies. Please note that before, clones of kernels would share argument values. This will no longer be the case, each copy of a kernel will have independent argument values.- If you were relying on shared argument values or if for some other reason
the new design does not work for you, you can wrap
Kernelwith anRc<RefCell<_>>orArc<Mutex<_>>.
- If you were relying on shared argument values or if for some other reason
the new design does not work for you, you can wrap
- The ocl-interop crate has been added to the project. This crate provides OpenCL <-> OpenGL interoperability. See the README for more.
-
Error handling has been completely revamed and now uses the failure crate. Breakages are unlikely and will only occur if your crate depended on certain, now removed, features. If you experience any breakages which are not obvious how to fix, please file an issue so that more instruction can be added here.
- The top level
oclcrate now has it's ownErrortype, distinct fromocl_core::Error. ocl::async::Errorhas been removed.
- The top level
-
Platform::firsthas had itsignore_env_varargument removed. If you previously calledPlatform::first(false)(to respect theOCL_DEFAULT_PLATFORM_IDXenvironment variable) you will now want to usePlatform::defaultinstead. If you previously calledplatform.first(true)you will now simply useplatform.first(). -
Buffernow uses a linearusizerather than a multi-dimensionalSpatialDimsto store its size.Buffer::newhas had itsdimsargument renamed tolen.Buffer::dimshas been renamed to::len.BufferBuilder::dimshas been renamed to::len.
-
Many types have had their
::coremethods renamed to::as_core. -
EventListandEventArrayhave had their::push_somemethods removed. -
RwVec::lenhas been renamed to::len_staleto clarify that the value returned is potentially out of date. -
(ocl-core) The
::scrambled_vec,::shuffled_vec, andshufflefunctions have been moved to theocl-extrascrate.randhas been removed as a dependency.
- The
ocl-coreandcl-sysrepositories have been merged into the mainoclrepository. - Various 'future guards' (such as
FutureReadGuard) now behave more gracefully when dropped before being polled.
Kernel::enq and KernelCmd::enq are now unsafe functions. Even though the
API call itself is safe, all kernel code is inherently untrusted and
potentially dangerous. This change is long overdue.
This change will break virtually all existing code, though the fix is trivial:
simply wrap all calls to .enq() in an unsafe block.
Before:
kernel.enq().unwrap();
Now:
unsafe { kernel.enq().unwrap(); }
Kernel::enqandKernelCmd::enqare now markedunsafe.BufferMapCmd::enqandBufferMapCmd::enq_asyncare now markedunsafe.Buffer::from_gl_bufferhas had itsdimsargument removed. Its size is now determined from the size of the OpenGL memory object.BufferWriteCmd::enq_asyncnow returns aFutureReadGuardinstead of aFutureWriteGuard. AFutureWriteGuardcan now be obtained by callingBufferWriteCmd::enq_async_then_write.Buffer::flagsnow returns a result.- The
FutureReadGuardandFutureWriteGuardtype aliases have been added.FutureReader<T>andFutureWriter<T>are equivalent and should be translated toFutureReadGuard<Vec<T>>andFutureWriteGuard<Vec<T>>.
- The
FutureRwGuardtype alias has been removed. FutureMemMaphas had its::set_wait_listmethod renamed to::set_lock_wait_events.FutureReadGuard/FutureWriteGuard:::set_wait_listhas likewise been renamed to::set_lock_wait_eventsand::set_command_completion_eventhas been renamed to::set_command_wait_event. Other similar methods have been renamed accordingly.FutureMemMap::set_unmap_wait_listhas been renamed to::set_unmap_wait_eventsand::create_unmap_completion_eventhas been renamed to::create_unmap_event. Other similar methods have been renamed accordingly.- (ocl-core)
::enqueue_write_buffer,::enqueue_write_buffer_rect,::enqueue_write_image,enqueue_kernel, andenqueue_taskare now correctly markedunsafe.
- Small changes to
BufferBuilderandKernelhave been made to maintain OpenCL 1.1 compatability. - The [
Platform::first] method has been added which, unlikePlatform::default, returns an error instead of panicking when no platform is available. ContextBuilder::new,ProQueBuilder::build, and some other methods which attempt to use the first available platform no longer panic when none is available.- (ocl-core)
enqueue_acquire_gl_bufferandenqueue_release_gl_bufferhave been deprecated in favor of the newenqueue_acquire_gl_objectsandenqueue_release_gl_objectsfunctions and will be removed in a future version. - (ocl-core)(WIP) The
get_gl_context_info_khrfunction along with theGlContextInfoandGlContextInfoResulttypes have been added but are still a work in progress. These can be used to determine which OpenCL-accessible device is being used by an existing OpenGL context (or to list all associable devices). Please see documentation notes and code if you can offer any help to get this working.
Buffer::newhas had thefill_valargument removed and continues to be unstable. Automatically filling a buffer after creation can be done using the appropriateBufferBuildermethods (fill_valandfill_event, see change below).BufferBuilder::fill_valnow only accepts a single argument, the value. Setting an associated event may now optionally be done using the newfill_event. Not setting an event continues to simply block the current thread until the fill is complete (just after buffer creation).ContextBuilder::gl_contextnow accepts a*mut c_voidinstead of an integer for its argument.- (ocl-core) Error handling has been changed and allows error chaining.
Matching against error variants now must be done using the
ErrorKindtype returned by theError::kindmethod. - (ocl-core) The
ContextPropertyValue::GlContextKhrvariant is now holds the*mut c_voidtype.
SpatialDimsnow derivesPartialEqandEq.
- Supported image format returned from various functions such as
core::get_supported_image_formatsorImage::supported_formatsare now individually result-wrapped allowing the use of these functions on platforms that return unsupported/unknown formats (Apple).
- Fix certain platform-specific issues.
- Remove a
printlnwhen building aProQue(oops).
The futures have arrived! The futures crate has begun to find its way into
ocl. This makes doing things like embedding/inserting host processing work
into the sequence of enqueued commands easy and intuitive. See the new
MemMap, RwVec, FutureMemMap, and FutureRwGuard types.
We will be approaching stabilization over the next year for all top level
types. Before that point can be reached, we'll have to break a few eggs. This
release brings consistency and simplification changes to a few important
functions, notably Buffer::new and Kernel::new. See the breaking
changes section below for details.
- Asynchrony and Futures:
- Buffers can now be mapped (and unmapped) safely both synchronously
(thread-blocking) and asynchronously (using futures) using
Buffer::map. - Calling
::read,::write, or::mapon aBuffer,Image,BufferCmdorImageCmdwill now return a specializedBufferReadCmd,BufferWriteCmd, orBufferMapCmdcommand builder. These three new special command builders provide an::enq_asyncmethod in addition to the usual::enqmethod. For these I/O commands only,::enqwill now always block the current thread until completion.::enq_asyncwill instead return a future representing the completion of the command and will also allow safe access to buffer data after the command has completed. This means that host-side processing can be easily inserted into the stream of OpenCL commands seamlessly using futures interfaces.
- Buffers can now be mapped (and unmapped) safely both synchronously
(thread-blocking) and asynchronously (using futures) using
- Sub-buffers can now be safely created from a
BufferusingBuffer::create_sub_buffer. - Default queues on kernels, buffers, and images are no longer mandatory. See the breaking changes section below for details on how this impacts existing code.
- Command queue properties can now be specified when creating a
QueueorProQueallowing out of order execution and profiling to be enabled. Profiling had previously been enabled by default but now must be explicitly enabled by setting theQUEUE_PROFILING_ENABLEflag. EventListhas undergone tweaking and is now a 'smart' list, being stack allocated by default and heap allocated when its length exceeds 8 events.EventArray, a stack allocated array of events, has been added.EventArrayis automatically used internally byEventListwhen necessary but can also be used on its own.- When setting a kernel argument, the type associated with the argument is now
checked against the type specified in the kernel's source code. This check
can be opted out of by using the new
Kernel::set_arg_uncheckedfunction described below. Kernel::set_arg_uncheckedandKernel::named_arg_idxhave been added allowing the ability to set a kernel argument by index and retrieve the index of a named argument. Argument indexes always correspond exactly to the order arguments are declared within the program source code for a kernel.Kernelbuffer and image related functions (such asarg_buf) can now interchangeably accept eitherBufferorImage.BufferCmd,ImageCmd,KernelCmd, et al. have received streamlining and optimizations with regards to events.- Complete rename, redesign, and macro-based reimplementation of all vector
types. Vector types now implement all of the same operations as scalar types
and use wrapping arithmetic (see breaking changes for more). There is also
now a scalar version for each type using all of the same (wrapping)
operations and naming conventions (ex.: Double, Int, Uchar). Future
optimization and/or interaction with the
ndarraycrate may be added if requested (file an issue and let us hear your thoughts).
-
Buffer::newcontinues to be unstable and is not recommended for use directly. Instead use the newBufferBuilderby callingBuffer::builderorBufferBuilder::new.-
Before:
Buffer::new(queue, Some(flags), dims, Some(&data)) -
Now:
Buffer::builder() .queue(queue) .flags(flags) .dims(dims) .host_data(&data) .build()
-
-
Kernel::newno longer accepts a queue as a third argument (and can now be considered stabilized). Instead use the::queue(builder-style) or::set_default_queuemethods. For example:-
Before:
Kernel::new("kernel_name", &program, queue)? -
Now:
Kernel::new("kernel_name", &program)?.queue(queue)
-
-
BufferCmd,ImageCmd, andKernelCmdhave undergone changes:::copysignature changeoffsetandlen(size) are now optional. Offset will default to zero and length will default to the entire length of the buffer.::enew,::enew_opt,::ewait, and::ewait_optfor command builders have had a signature change and now use generics. This may affect certain types of casts.
-
Buffer::is_emptyhas been removed. -
Buffer::from_gl_buffer,Buffer::set_default_queue,ImageBuilder::build,ImageBuilder::build_with_data,Image::new,Image::from_gl_texture,Image::from_gl_renderbuffer,Image::set_default_queue,Kernel::set_default_queuenow take an ownedQueueinstead of a&Queue(clone it yourself). -
All row pitch and slice pitch arguments (for image and rectangular buffer enqueue operations) must now be expressed in bytes.
-
Kernel::set_default_queueno longer result-wraps its&'mut Kernelreturn value. -
Kernelnamed argument declaration functions such as::arg_buf_namedor::set_arg_img_namedcalled with aNonevariant must now specify the full type of the image, buffer, or sub-buffer which will be used for that argument. Where before you might have used:.arg_buf_named::<f32>("buf", None)you must now use:
.arg_buf_named("buf", None::<Buffer<f32>>)or:
.arg_buf_named::<f32, Buffer<f32>>("buf", None) -
Queue::newnow takes a third argument,properties(details below in ocl-core section). -
Queue::finishnow returns a result instead of unwrapping. -
Program::newhas had its arguments rearranged for consistency. -
Event::waitandEventList::waithave both been renamed to::wait_forto avoid conflicts with the [Future] trait. The new futures versions of::waitdo exactly the same thing however. -
::core_as_refand::core_as_mutfor several types have been renamed to::coreand::core_mut. -
[Vector types] have been redesigned and moved into their own sub-crate:
- The
Clprefix for each type has been removed. - Tuple struct notation for creation has been removed. Use
::newor::from. - All arithmetic operations are fully implemented and are wrapping.
- Bitwise and shift operators have been added for integer types.
- Now located within the [
ocl::prm] module.
- The
Breaking changes specific to ocl-core
- Passing event wait list and new event references has been completely
overhauled. Previously, references of this type had to be converted into the
trait objects
ClWaitListandClEventPtrNew. This was convenient (outside of the occasional awkward conversion) and obviated the need to type annotate every time you passedNoneto anenqueue_...function. Now that futures have come to the library though, every last ounce of performance must be wrung out of event processing. This means that events and event lists are now treated as normal generics, not trait objects, and are therefore optimally efficient, at the cost of it being less convenient to call functions when you are not using them.- The
ClWaitListtrait has been renamed toClWaitListPtr - The
ClEventPtrNewtrait has been renamed toClNullEventPtr - All
core::enqueue_...functions (and a few others) may now require additional type annotations whenNoneis passed as either the event wait list or new event reference. Passing aNone::<Event>will suffice for either parameter (because it can serve either role) and is the easiest way to shut the compiler up. If you were previously annotating a type using the 'turbo-fish' syntax ('::<...>') on one of these functions, you will also have to include two additional type annotations. It may be more convenient to do all the annotation in one spot in that case and remove it from theNones.
- The
- All row pitch and slice pitch arguments (for image and rectangular buffer operations) must now be expressed in bytes.
EventList::popnow returns anOption<Event>instead of anOption<Result<Event>>.::create_command_queuenow takes a third argument:properties, an optional bitfield described in the clCreateCommandQueue SDK Documentation. Valid options includeQUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLEandQUEUE_PROFILING_ENABLE.::build_programthedevicesargument is now optional. Not specifying any devices will cause the program to be built for all available devices within the provided context.::enqueue_map_buffer,::enqueue_map_image, and::enqueue_unmap_mem_objecthave had signature changes.
FIXME: Change doc link root to https://docs.rs/ocl/0.13/ at release.
Buffer::newhas undergone small signature changes.- The
queueargument now accepts an owned rather than a borrowedQueue.Buffernow stores it's ownocl::Queue(changed from acore::CommandQueue, a result of the addition of the 'version control' system). It is now left to the caller to clone the queue when necessary. - The
dimsargument is now constrained byInto<SpatialDims>rather thanMemLenfor consistency with other arguments of it's kind.
- The
Buffernow has a::dimsmethod which returns aSpatialDimsreference.Device::list,::list_all,::list_select, and::list_select_wrapnow wrap their return value in anocl::Result.Device::max_wg_sizenow returns anocl::Resultinstead of panicing.ProQue::max_wg_sizenow returns anocl::Resultinstead of panicing.EventList::pushandEventList::pophave been added.- ocl-core:
::create_contextand::create_context_from_typehave had their signatures changed. Thepropertiesargument is now anOption<&ContextProperties>.
The core and ffi modules have been moved out into new crates,
ocl-core and cl-sys respectively. They
continue to be exported with the same names. This document will continue to
contain information pertaining to all three libraries (ocl,
ocl-core, and cl-sys). Issues will
likewise be centrally handled from the ocl repo page.
The version control system has been implemented. Functions added since OpenCL 1.1 now take an additional argument to ensure that the device or platform supports that feature. See the ocl-core crate documentation for more information.
Context::platformnow returns aOption<&Platform>instead ofOption<Platform>to make it consistent with other methods of its kind.- (ocl-core)
DeviceSpecifier::to_device_listnow accepts aOption<&Platform>. - (ocl-core) Certain functions now require an additional argument for version control purposes (see the ocl-core crate documentation).
- [cl-sys] Types/functions/constants from the
cl_hmodule are now re-exported from the root crate.cl_his now private. - [cl-sys] Functions from the OpenCL 2.0 & 2.1 specifications have been added. This may cause problems on older devices. Please file an issue if it does.
- Vector types have been added making their use more intuitive.
- MSVC support is working and should be much easier to get running (more simplification to linking libraries coming).
- Preliminary OpenGL interop support:
- OpenGL context handles are accepted as properties during
Contextcreation.- Note: The new methods involved in this may soon be renamed.
- Buffers can be created from a GL object.
- OpenGL context handles are accepted as properties during
- The command builders for kernel, buffer, and image now accept either an
EventorEventListargument when setting the wait list using::ewaitor::ewait_opt. Awkward type ascriptions when not passing a wait list can now be removed due to the use of a trait object argument type. - 'fill' methods now accept a vector type.
Kernel::arg_vecnow takes a vector type.
Ocl is now confirmed to work on Rust-Windows-GNU (MSYS2/MinGW-w64). AMD and
Intel drivers appear to work flawlessly. NVIDIA drivers have glitches here and
there (particularly to do with concurrency) but are mostly functional.
Windows-MSVC testing is in progress. A short HOWTO for getting OpenCL drivers
installed properly and working with Rust is in the works. For now just be sure
to put a copy of the ICD loader, OpenCL.dll, usually found somewhere within
the C:\Windows folder tree, into the Rust library folder (defaults to
C:\Program Files\{Rust folder}\lib\rustlib\x86_64 -pc-windows-gnu\lib) and
make sure your platform drivers are installed correctly (there's a registry
setting + they must be in the PATH). See README.md for links to drivers.
Still no verification on the status of OS X but there is no reason it shouldn't work fine.
ImageBuilderhas had itsrow_pitchandslice_pitchmethods renamed torow_pitch_bytesandslice_pitch_bytesto indicate the units they expect their arguments expressed in.core::unload_platform_compilerhas been removed due to platform incompatability with some drivers.- The
KernelArg::Scalarvariant now contains a primitive rather than a primitive reference. ::src_file_nameand::get_file_nameshave been removed fromProgramBuilder. Use::src_fileto set a source filePathorPathBufto include in the build.- The
BuildOpt::cmplr_optmethod has been removed. - The
buildmodule has been renamed tobuilders.
Bufferhas undergone a major redesign:- The optional built-in vector has been removed. Reads and writes must now all be done using a separate data container.
- All of the methods for reading and writing have been removed and
replaced by the new command builder system, accessible with
::cmd(more documentation to come). - All of the traits pertaining to the internal vector, such as Index, have been removed.
- All of the constructors have been removed and replaced by a single
method,
::new. - Many of the convenience methods for initializing buffers with randomly
scrambled or shuffled data now take the form of functions as,
::scrambled_vecand::shuffled_vecinocl::util. ::set_queuehas been renamed::set_default_queue.::waithas been removed. Queue related methods are now accessed on the queue itself using::queue.- Length is no longer padded out to the next workgroup size. It is up to
the consumer to pad the sizes of buffers (the new kernel method,
::wg_infocan help determine optimal sizes).
Imagehas also had its read/write methods removed and replaced with a command builder accessible using::cmd(more documentation to come).Image::set_queuehas been renamed::set_default_queue.Kernelhas had its various::enqueue_***methods removed and replaced with, you guessed it, a command builder (::cmd).Kernel::newno longer accepts a global work size as an argument. Instead use the new builder-style method,::gwsafter creating.Kernel::set_queuehas been renamed::set_default_queue.Queue::new_by_device_indexhas been removed.- The
deviceargument forQueue::newis no longer optional. ProgramBuilder::src_filenow takes aPathinstead of a string.ProQue::create_kernel_with_dimshas been removed.ProQue::device_idxhas been replaced by::device.Context::new_by_index_and_typehas been removed.core::set_kernel_argand::enqueue_kernelno longer have an argument for the kernel function name. Instead it is queried when needed using::get_kernel_info.SimpleDimshas been renamedSpatialDimsand many of its methods now returnResulttypes.OclNumhas been renamedOclPrm
- Command builders for
Kernel,Buffer, andImagecan now be used by calling::cmdon each. - Rectangular reads, writes, and copies are now wired up and have been tested.
- Most of the remaining functions in the
coremodule have been implemented. Coverage is now about 98%. Samplerhas been added along with the appropriate methods onKernelto accept samplers as arguments. Seeexamples/image.rsfor usage.- Dimensions for images, buffers, kernels, and everything else can now be
specified by using a tuple OR array with 1, 2, or, 3 components (i.e.
[80, 150],(5, 1, 7)or just[250]).
Kernel::enqueueis now calledKernel::enqueue_withand has an additional parameter to set an alternative command queue. A new method with the old name is now a convenience shortcut for.enqueue_with(None, None, None).ProQue::create_kernelhas been renamedProQue::create_kernel_with_dims. A new method with the old name, is now a shortcut for kernel creation using pre-assigned dimensions` (this naming is likely temporary).- The kernel created using
ProQue::create_kernelis no longer wrapped in a result and instead panics if there is a problem. If you require a non-panicing way to create a kernel useKernel::new. Context::newhas been redesigned. It is now recommended to useContext::builderor its equivalent,ContextBuilder::new' to create aContext`.Queue::newnow takes aDeviceas its second argument. Use the newContext::get_device_by_indexto achieve the same result.- All 'standard' types refer to
DeviceandPlatforminstead ofcore::DeviceIdandcore::PlatformIdin method signatures. Buffer::read_asyncand::write_asynchave been renamed::enqueue_readand::enqueue_writeand have an additional parameter to set blocking.Buffer::fill_vec_asyncand::flush_vec_asynchave been renamed::enqueue_fill_vecand::enqueue_flush_vecand have an additional parameter to set blocking.
- Images! I can see! ... oh shut up.
ImageandImageBuilderhave been added. Please see their documentation along withexamples/image.rs.
- Some methods and functions now return results where before they would unwind.
- The
::releasemethod has been removed from those types which still had it. All types now automatically release their resources properly. Buffer::fill_vecandBuffer::flush_vecno longer return results and instead panic in the event of an error.- All of the
Buffercreation methods (such as::newand::with_vec) now take a reference to aBufferDimstype for thedimsargument instead moving it. - The
rawmodule has been renamed tocorefor clarity. - Functions in the
coremodule now take references to*Rawtypes instead of copying them. *Rawtypes no longer implementCopy.- Many of the method names dealing with references to
coreobjects have been renamed.
corehas a considerable number of newly implemented (and unimplemented placeholder) functions.- Many 'info' functions and types have been added. See the example,
info.rs, for details on how to use them. - All types are now completely safe to clone (where appropriate) and share
between threads (with the exception of
Kernel, for good reason) and are reference counted automatically in coordination with the API to ensure safe and leak-free destruction.
Lots of changes, breaking and otherwise:
A new type, Image has been added for processing images. It is still very
much a work in progress.
The new raw api allows access to OpenCL™ FFI functions with only a
thin layer of abstraction providing safety and convenience. Using functions in
this module is only recommended for use when functionality has not yet been
implemented on the 'standard' ocl interfaces.
Bufferhas had several methods dealing with reading and writing renamed and two new ones created.::flush_vecand::fill_vechave been renamed to::flush_vec_asyncand::fill_vec_async.::flush_vec_waitand::fill_vec_waithave been renamed to::flush_vecand::fill_vec.::readand::writehave been renamed::read_asyncand::write_async.- Blocking versions of read and write have been created called, you guessed
it,
::readand::write. The more straightforward, blocking versions of these methods now have the simplest names wheras the more complicated, non-blocking versions have the_asyncsuffix.
Buffernon-blocking read methods (*_async) are now unsafe pending review.Bufferreading and writing methods now return aResult<()>.- The
Buffer::with_vec_shuffledandBuffer::with_vec_scrambledmethods now accept a 2-tuple as the first argument instead of two separate values for the first two arguments. ProQue::buildhas been renamedProQue::build_program.BuildOptionshas been renamed toProgramBuilderand has been redesigned:- A new
ProgramBuildercan be created withProgramBuilder::neworProgram::builder. - The
::buildmethod has been added, consuming the builder and returning a newProgram. - Methods dealing with kernel source code have been renamed for clarity.
- Extraneous methods have been removed.
- A new
- The following methods on
Kernelhave been renamed reflectingEnvoyhaving been recently renamed toBufferin v0.4.0:::arg_envto::arg_buf::arg_env_namedto::arg_buf_named::set_arg_env_namedto::set_arg_buf_named
- Several non-essential methods on
Kernelhave been depricated. Kernel::newand its equivalent,ProQue::create_kernel, now return aResult<Kernel>instead of justKernel.Kernel::set_arg_buf_namedandKernel::set_arg_buf_namednow require anOptionwrapper.SimpleDimshas had its variants renamed.WorkSizehas been renamed toWorkDimsand has had its variants renamed.Context::newnow takes aDeviceTypeinstead of a u32.
ProQueBuilderis now the most boilerplate-free way to create an OpenCL context, program, and queue. Create one by calling [ProQue::builder]. Seebasics.rsfor an example and documentation for more info.Imageis still a newborn.
“OpenCL and the OpenCL logo are trademarks of Apple Inc. used by permission by Khronos.”