# Input / Output Pointer Type Passed Into Plugin's enqueue function

**URL:** <https://forums.developer.nvidia.com/t/input-output-pointer-type-passed-into-plugins-enqueue-function/107070>\
**Category:** TensorRT\
**Created:** [November 8, 2019, 3:31am UTC](https://forums.developer.nvidia.com/t/input-output-pointer-type-passed-into-plugins-enqueue-function/107070 "2019-11-08T03:31:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alvinsun](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@alvinsun](https://forums.developer.nvidia.com/u/alvinsun)\
**Post date:** [November 8, 2019, 3:31am UTC](https://forums.developer.nvidia.com/t/input-output-pointer-type-passed-into-plugins-enqueue-function/107070/1 "2019-11-08T03:31:41Z")

</div>

What type of memory is associated with the input / output pointers passed into the enqueue method of a plugin?

```auto
virtual int nvinfer1::IPlugin::enqueue(int batchSize,
    const void *const *inputs,
    void **outputs,
    void *workspace,
    cudaStream_t stream 
)

```

It seems like the memory pointer can be accessed both by CPU and GPU. So are they managed memory?

---

<div class="post-metadata">

**Author:** ![SunilJB](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/suniljb/32/14043_2.png) [@SunilJB](https://forums.developer.nvidia.com/u/SunilJB)\
**Post date:** [November 25, 2019, 5:57am UTC](https://forums.developer.nvidia.com/t/input-output-pointer-type-passed-into-plugins-enqueue-function/107070/2 "2019-11-25T05:57:48Z")

</div>

Hi,

Enqueue uses device memory for all the operations (input, output).  
Input formats:

- (N, C, H, W) for 2D Convolution.
- (N, C, D, H, W) for 3D convolution.

Thanks

---

<div class="post-metadata">

**Author:** ![alvinsun](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@alvinsun](https://forums.developer.nvidia.com/u/alvinsun)\
**Post date:** [November 28, 2019, 1:15pm UTC](https://forums.developer.nvidia.com/t/input-output-pointer-type-passed-into-plugins-enqueue-function/107070/3 "2019-11-28T13:15:29Z")

</div>

Hi,

Thanks for the reply. That is my initial guess. However, the below enqueue implementation runs without any memory error and comes out with expected outputs. Does that mean the memory is accessible through CPU also?

```auto
class SomePlugin : IPlugin... {
    ...
    int enqueue(int batchSize, const void* const* inputs, void** outputs, void* workspace,                                                                                       
                cudaStream_t stream) override {
        *(outputs[0]) = 10;
    }
    ...
}

```
