Dim3 supplement4/19/2023 ![]() Get the current CUDA stream used by ArrayFireīelow we provide two worked examples on how ArrayFire can be integrated into new and existing projects. Switches ArrayFire to the specified CUDA device ID Switches ArrayFire to the specified deviceĬonverts an ArrayFire device ID to a CUDA device ID Restore’s ArrayFire’s control over a device memory pointer Removes ArrayFire’s control of a device memory pointer Obtain a pointer to the device memory (implies lock() ArrayFire provides several functions to ease this process including: FunctionĬonstruct an ArrayFire Array from device memory It is fairly straightforward to interface ArrayFire with your own custom CUDA code. ![]() NOTE: This blog post was written against ArrayFire 3.3.x. We intend to implement additional convenience functions in ArrayFire 3.4 that should simplify this process further. Be sure to check the documentation for any updates in future releases. When it comes to interoperability with CUDA, the most important thing to remember about ArrayFire is that it manages its own memory, runs in its own CUDA stream, and creates custom IDs for devices. As such, most of the interoperability functions focus on reducing potential synchronization conflicts between ArrayFire and CUDA. Today’s “ Learning ArrayFire from scratch“, blog post discusses how you can interface ArrayFire and CUDA. ![]() ![]() For example, you may wish to add ArrayFire to an existing code base to increase your productivity, or you may need to supplement ArrayFire’s functionality with your own custom implementation of specific algorithms. Although ArrayFire is quite extensive, there remain many cases in which you may want to write custom kernels in CUDA or OpenCL. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |