A lot of the cusparse/cublas functions utilize scratch space (e.g the tridiagonal solve in cusparse uses a scratch space roughly equal to the size of the right hand side to be solved). When this becomes large, it makes it difficult to manage ones own memory, because we are unable to allocate this scratch space ourselves. It just tries to allocate it with each function call. This is one of my major issues at the moment with constructing my own memory manager.
Has anyone found a workaround to this problem?