# No documentation?- constant memory with CPU threads

**URL:** <https://forums.developer.nvidia.com/t/no-documentation-constant-memory-with-cpu-threads/21924>\
**Category:** CUDA Programming and Performance\
**Created:** [April 10, 2011, 8:12am UTC](https://forums.developer.nvidia.com/t/no-documentation-constant-memory-with-cpu-threads/21924 "2011-04-10T08:12:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sightera](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@sightera](https://forums.developer.nvidia.com/u/sightera)\
**Post date:** [April 10, 2011, 8:12am UTC](https://forums.developer.nvidia.com/t/no-documentation-constant-memory-with-cpu-threads/21924/1 "2011-04-10T08:12:08Z")

</div>

Hi,  
Can several CPU threads write to constant memory in CUDA 4 ?  
If several CPU threads are writing to constant memory, will they override each other memory ?

---

<div class="post-metadata">

**Author:** ![tmurray](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@tmurray](https://forums.developer.nvidia.com/u/tmurray)\
**Post date:** [April 10, 2011, 5:36pm UTC](https://forums.developer.nvidia.com/t/no-documentation-constant-memory-with-cpu-threads/21924/2 "2011-04-10T17:36:51Z")

</div>

depends if those threads are writing to the same context or not

---

<div class="post-metadata">

**Author:** ![sightera](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@sightera](https://forums.developer.nvidia.com/u/sightera)\
**Post date:** [April 10, 2011, 7:00pm UTC](https://forums.developer.nvidia.com/t/no-documentation-constant-memory-with-cpu-threads/21924/3 "2011-04-10T19:00:27Z")

</div>

> [@](#):
>
> depends if those threads are writing to the same context or not

Let me see if I understand correctly -

in CUDA 4.0 if you run several CPU threads using C-for-CUDA all running the same CPU code,

which writes some CPU-thread-dependent values to the same _const_ variable in the host, there will be problems, right ?

If right, is there a workaround for that ? How can you make the device regard each such write to the constant memory as different and use a different portion

of the constant memory per CPU thread (as done for different _constant_ variables) ?

Along the same lines - what is the behavior of a similar case, with texture memory ? same problems ?

(Lot’s of questions because the programmer’s guide provide enough documentation about this).

Thanks !

---

<div class="post-metadata">

**Author:** ![sightera](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@sightera](https://forums.developer.nvidia.com/u/sightera)\
**Post date:** [April 12, 2011, 6:34am UTC](https://forums.developer.nvidia.com/t/no-documentation-constant-memory-with-cpu-threads/21924/4 "2011-04-12T06:34:20Z")

</div>

> [@](#):
>
> depends if those threads are writing to the same context or not

Thanks for your comment. Could you please elaborate ? There is not much documentation regarding these issue…
