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

Small fixes for CachingDeviceAllocator#328

Merged
alliepiper merged 2 commits into
NVIDIA:mainfrom
fkallen:allocatorprintfix
Jul 22, 2021
Merged

Small fixes for CachingDeviceAllocator#328
alliepiper merged 2 commits into
NVIDIA:mainfrom
fkallen:allocatorprintfix

Conversation

@fkallen

@fkallen fkallen commented Jun 22, 2021

Copy link
Copy Markdown
Contributor

This PR fixes the following issues

The following code prints correct number of cached bytes, but incorrect number of cached blocks.


int main(){
    cub::CachingDeviceAllocator alloc(
        false, //skip_cleanup 
        true //debug
    );

    void* ptr;
    alloc.DeviceAllocate(&ptr, 128);
    alloc.DeviceFree(ptr);
    alloc.FreeAllCached();
}
Device 0 allocated new device block at 0x7fffca400000 (512 bytes associated with stream 0).
        0 available blocks cached (0 bytes), 1 live blocks outstanding(512 bytes).
Device 0 returned 512 bytes from associated stream 0.
         1 available blocks cached (512 bytes), 0 live blocks outstanding. (0 bytes)
Device 0 freed 512 bytes.
          1 available blocks cached (0 bytes), 0 live blocks (0 bytes) outstanding.

Mutex remains locked in DeviceFree if error occured.

@fkallen fkallen changed the title Print updated number of cached blocks in CachingDeviceAllocator::Free… Small fixes for CachingDeviceAllocator Jun 23, 2021
@alliepiper alliepiper added this to the 1.14.0 milestone Jun 23, 2021
@alliepiper alliepiper self-assigned this Jun 23, 2021
@alliepiper

Copy link
Copy Markdown
Collaborator

LGTM, I'll start tests and get this merged for 1.14.0. Thanks!

alliepiper added a commit to alliepiper/thrust that referenced this pull request Jul 8, 2021
@alliepiper

Copy link
Copy Markdown
Collaborator

Rebased to pull in some recent CI fixes.

DVS CL: 30167003
gpuCI: NVIDIA/thrust#1480

@alliepiper alliepiper added testing: gpuCI in progress Started gpuCI testing. testing: internal ci in progress Currently testing on internal NVIDIA CI (DVS). labels Jul 8, 2021
alliepiper added a commit to alliepiper/thrust that referenced this pull request Jul 21, 2021
@alliepiper

Copy link
Copy Markdown
Collaborator

Rebased for more CI fixes...

DVS CL: 30211025
gpuCI: NVIDIA/thrust#1480

@alliepiper alliepiper left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests pass, LGTM!

@alliepiper alliepiper merged commit 6029a58 into NVIDIA:main Jul 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

testing: gpuCI in progress Started gpuCI testing. testing: internal ci in progress Currently testing on internal NVIDIA CI (DVS).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants