# @Cuda.jit is there cache=True?

**URL:** <https://numba.discourse.group/t/cuda-jit-is-there-cache-true/163>\
**Category:** Support: How do I do ...?\
**Created:** [August 7, 2020, 1:39pm UTC](https://numba.discourse.group/t/cuda-jit-is-there-cache-true/163 "2020-08-07T13:39:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sirkrisp](https://yyz2.discourse-cdn.com/free1/user_avatar/numba.discourse.group/sirkrisp/32/89_2.png) [@sirkrisp](https://numba.discourse.group/u/sirkrisp)\
**Post date:** [August 7, 2020, 1:39pm UTC](https://numba.discourse.group/t/cuda-jit-is-there-cache-true/163/1 "2020-08-07T13:39:13Z")

</div>

Is it possible to cache cuda jit compiled code? I tried to pass cache=True in @cuda.jit but can’t find any compiled code in the cache dir.

Thanks in advance!

Best,  
Kris

---

<div class="post-metadata">

**Author:** ![animator](https://yyz2.discourse-cdn.com/free1/user_avatar/numba.discourse.group/animator/32/119_2.png) [@animator](https://numba.discourse.group/u/animator)\
**Post date:** [August 7, 2020, 3:00pm UTC](https://numba.discourse.group/t/cuda-jit-is-there-cache-true/163/2 "2020-08-07T15:00:22Z")

</div>

Are you using a Python script or Jupyter notebook?

---

<div class="post-metadata">

**Author:** ![sirkrisp](https://yyz2.discourse-cdn.com/free1/user_avatar/numba.discourse.group/sirkrisp/32/89_2.png) [@sirkrisp](https://numba.discourse.group/u/sirkrisp)\
**Post date:** [August 7, 2020, 4:29pm UTC](https://numba.discourse.group/t/cuda-jit-is-there-cache-true/163/3 "2020-08-07T16:29:23Z")

</div>

Thanks for your reply. For both, in a jupyter notebook and in a python script, there have been no entries generated in the corresponding cache directories. There are, however, entries for compiled CPU code.

This is a simple test code which generates code for subtract but not for sub\_cuda:

```python
from numba import cuda
import numba as nb
import numpy as np

@nb.jit("int64[:](int64[:],int64[:])",cache=True)
def subtract(a,b):
    return a - b

@cuda.jit("void(int64[:],int64[:],int64[:])",cache=True)
def sub_cuda(a,b,c):
    start = cuda.grid(1)
    stride = cuda.gridsize(1)
    for i in range(start, a.shape[0], stride):
        c[i] = a[i] - b[i]

a = np.ones(3,dtype=np.int64)
b = np.ones(3,dtype=np.int64)
c = np.ndarray(3,dtype=np.int64)
sub_cuda[64,128](a,b,c)
d = subtract(a,b)
print(c,d)

```

---

<div class="post-metadata">

**Author:** ![gmarkall](https://yyz2.discourse-cdn.com/free1/user_avatar/numba.discourse.group/gmarkall/32/42_2.png) [@gmarkall](https://numba.discourse.group/u/gmarkall)\
**Post date:** [August 7, 2020, 11:06pm UTC](https://numba.discourse.group/t/cuda-jit-is-there-cache-true/163/4 "2020-08-07T23:06:41Z")

</div>

Unfortunately there is no support for caching in the CUDA target at present. (Apologies for brevity, on mobile)
