Skip to content

[SYCLomatic] Make device_vector AllocatorAwareContainer #2

Closed
danhoeflinger wants to merge 5 commits intoSYCLomaticfrom
dev/dhoeflin/device_vector_allocator_aware_shared
Closed

[SYCLomatic] Make device_vector AllocatorAwareContainer #2
danhoeflinger wants to merge 5 commits intoSYCLomaticfrom
dev/dhoeflin/device_vector_allocator_aware_shared

Conversation

@danhoeflinger
Copy link
Owner

@danhoeflinger danhoeflinger commented Apr 5, 2023

Changes to make dpct::device_vector allocator aware, while still relying upon a USM shared memory allocator.

This should satisfy the requirements of AllocatorAwareContainer.

With the underlying data being host accessible, we can fully satisfy AllocatorAwareContainer.

@danhoeflinger danhoeflinger marked this pull request as ready for review May 3, 2023 21:24
@danhoeflinger danhoeflinger changed the title device_vector becoming allocator aware with USM shared memory allocator [SYCLomatic] Make device_vector AllocatorAwareContainer May 3, 2023
@danhoeflinger danhoeflinger force-pushed the dev/dhoeflin/device_vector_allocator_aware_shared branch from a796e52 to 533db9f Compare May 4, 2023 12:57
@danhoeflinger danhoeflinger force-pushed the dev/dhoeflin/device_vector_allocator_aware_shared branch from dba5682 to b20d9e8 Compare July 10, 2023 15:16
@danhoeflinger danhoeflinger force-pushed the dev/dhoeflin/device_vector_allocator_aware_shared branch from a2ff17b to 0381399 Compare August 3, 2023 16:15
@danhoeflinger danhoeflinger force-pushed the dev/dhoeflin/device_vector_allocator_aware_shared branch from 0381399 to f802788 Compare August 11, 2023 21:44
@danhoeflinger danhoeflinger force-pushed the dev/dhoeflin/device_vector_allocator_aware_shared branch from b22c09c to cbe9738 Compare October 26, 2023 18:26
device allocated USM seamless host access

construct allocator aware (BROKEN: cant pass allocator to kernel)

working with static construct function

Fix treatment of default constructor

adding destroy functionality

making device_allocator_traits similar to std

switch to using oneDPL range functionality; misc.

Comments

removing unnecessary TODO

Adding warning to usm_device_allocator

clang-format

provide explicit copy constructor

remove ambiguous constructor

device_vector AllocatorAwareContainer requirements

Fix bug with operator--

removing custom swap kernel

adjusting device reference to hold ptr internally

passing pointer, not reference to device_reference

(breaking) bug fix

strip out device USM specific code

using std::allocator_traits for all

Always destroy now, since no kernel is launched

removing redundant copy

formatting

move assignment operator bugfix

fixing inc file and formatting

using size_type not int

adding missing destroy calls

reusing existing code

removing automatic doubling of capacity requested

parallel copy instead of construct calls

fixes for propagation of allocator

formatting and updating inc file

fixing comment

more fixes for constructing vs copy / fill

adding ctors with allocators

using ctor delegation where appropriate

Formatting

fixing bad merge

::std

replacing redundant constructors with default args

alias for allocator_traits

fixing wrong allocator for move const

skipping copies if not relevant

optimization when sequences dont overlap in erase

formatting, removing typo

use onedpl when custom ctor isn't provided

clang formatting

adding comment

forcing pointer type for construction

protecting unknown InputIterators from being used in oneDPL accelerated routines

removing host parallel calls

switching to value constructor

fixing erase and adding destroy

clang format
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
assign elements more efficiently

swap elements more efficiently

filling elements more efficiently

formatting

Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
@danhoeflinger danhoeflinger force-pushed the dev/dhoeflin/device_vector_allocator_aware_shared branch from 5fd5a3d to db348fa Compare March 4, 2024 20:05
danhoeflinger pushed a commit that referenced this pull request Apr 8, 2024
This reverts commit daebe5c.

This commit causes the following asan issue:

```
<snip>/llvm-project/build/bin/mlir-opt <snip>/llvm-project/mlir/test/Dialect/XeGPU/XeGPUOps.mlir | <snip>/llvm-project/build/bin/FileCheck <snip>/llvm-project/mlir/test/Dialect/XeGPU/XeGPUOps.mlir
# executed command: <snip>/llvm-project/build/bin/mlir-opt <snip>/llvm-project/mlir/test/Dialect/XeGPU/XeGPUOps.mlir
# .---command stderr------------
# | =================================================================
# | ==2772558==ERROR: AddressSanitizer: stack-use-after-return on address 0x7fd2c2c42b90 at pc 0x55e406d54614 bp 0x7ffc810e4070 sp 0x7ffc810e4068
# | READ of size 8 at 0x7fd2c2c42b90 thread T0
# |     #0 0x55e406d54613 in operator()<long int const*> /usr/include/c++/13/bits/predefined_ops.h:318
# |     #1 0x55e406d54613 in __count_if<long int const*, __gnu_cxx::__ops::_Iter_pred<mlir::verifyListOfOperandsOrIntegers(Operation*, llvm::StringRef, unsigned int, llvm::ArrayRef<long int>, ValueRange)::<lambda(int64_t)> > > /usr/include/c++/13/bits/stl_algobase.h:2125
# |     #2 0x55e406d54613 in count_if<long int const*, mlir::verifyListOfOperandsOrIntegers(Operation*, 
...
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant