Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Caching Device Allocator fails with debug output enabled #45

Closed
dumerrill opened this issue Jun 14, 2016 · 3 comments
Closed

Caching Device Allocator fails with debug output enabled #45

dumerrill opened this issue Jun 14, 2016 · 3 comments

Comments

@dumerrill
Copy link
Contributor

Bryan F

Jun 1

Visual Studio 2013, CUDA 7.5, CUB 1.5.2

Error in util_allocator.cuh@Line 414: map/set iterator not dereferencable

This issue is caused by erase being called on the block iterator before the debug output is printed.

cached_blocks.erase(block_itr);
cached_bytes[device].free -= search_key.bytes;
cached_bytes[device].live += search_key.bytes;

if (debug) _CubLog("\tDevice %d reused cached block at %p (%lld bytes) for stream %lld (previously associated with stream %lld).\n",
device, search_key.d_ptr, (long long)search_key.bytes, (long long)search_key.associated_stream, (long long)block_itr->associated_stream);

Fixed:

cached_bytes[device].free -= search_key.bytes;
cached_bytes[device].live += search_key.bytes;

if (debug) _CubLog("\tDevice %d reused cached block at %p (%lld bytes) for stream %lld (previously associated with stream %lld).\n",
device, search_key.d_ptr, (long long)search_key.bytes, (long long)search_key.associated_stream, (long long)block_itr->associated_stream);

cached_blocks.erase(block_itr);

The same error should occur at several locations where block_itr is used in the debug output.

dumerrill added a commit that referenced this issue Oct 11, 2016
Caching Device Allocator fails with debug output enabled
@ghost
Copy link

ghost commented Nov 17, 2016

Should this issue be closed?

@thompsonbry
Copy link

Adding James.
Bryan

On Thu, Nov 17, 2016 at 8:24 AM, Daniel Trebbien [email protected]
wrote:

Should this issue be closed?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/NVlabs/cub/issues/45#issuecomment-261293949, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ACdv4FQNBdUr_xowhpfk73y8qcc1P3pMks5q_H_GgaJpZM4I1nR3
.

@dumerrill
Copy link
Contributor Author

Fixed in the above commit for v1.5.5

dumerrill added a commit that referenced this issue Aug 11, 2017
Caching Device Allocator fails with debug output enabled

Former-commit-id: 1d02d255f29e41a382a38c10726a968e5050d0a8
sarvex pushed a commit to sarvex/cub that referenced this issue Apr 27, 2023
Caching Device Allocator fails with debug output enabled

Former-commit-id: 1d02d255f29e41a382a38c10726a968e5050d0a8
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants