Comments (1)
In #391, a resource wrapper is introduced to allow for automatic memory management. Since this is highly related to the copy and resize support, future design decisions involving the wrapper will likely also affect this proposal. In particular, the C++ standard seems to introduce several non-owning reference classes (to which our containers are currently very similar):
- C++17:
string_view
- C++20:
atomic_ref
(implemented by stdgpu),span
- C++23:
mdspan
- C++26:
function_ref
(as of now)
Thus, an alternative, yet similar proposal would be the following:
- Introduce
*_ref
/*_view
reference classes which include all functionality (except the factory functions) of the current containers, which effectively results in a renaming of all containers with an appropriate reference type suffix. - Make the actual container classes automatically manage their memory similar to
device_unique_object
and additionally make them deep-copyable on the host only. Furthermore, addoperator*
andoperator->
functions for convenient conversion to their corresponding reference types.
This would move the API much closer to the C++ standard while clearly communicating that crossing the host-device memory boundary is only safely doable via the similarly named reference types.
from stdgpu.
Related Issues (20)
- Implement at() in terms of operator[] to avoid bound checks in deque and vector HOT 5
- Cannot include stdgpu to an existing OpenMP/HIP project HOT 9
- Build suceeds but cannot include package and build HOT 2
- Any chance to support spirv as a backend? HOT 3
- Failed to build project with stdgpu. Error: expected unqualified-id before ‘sizeof’ HOT 5
- Unordered_maps with complex containers HOT 1
- error: redefinition of ‘constexpr const bool stdgpu::numeric_limits<T>::is_specialized’ HOT 5
- Minimize thrust dependency HOT 1
- Compatibility with Thrust? HOT 3
- Raise minimum requirements to C++17
- Solve compilation error in Ubuntu 22.04 and friends HOT 1
- unordered_map creation crashing with cuda 12.x HOT 15
- unordered map creation freezes async processes HOT 10
- Execution policy support for all containers HOT 1
- Unordered_set with structure HOT 3
- About _excess_list_positions used in unordered_set HOT 2
- About stdgpu::queue size < 0 HOT 4
- Findthrust.cmake parse error HOT 1
- Unexpected insertion when using unordered_map and capacity equals to 4 HOT 2
- Please help to answer the two questions about this, thank you HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stdgpu.