How to create a CUDA context?

后端 未结 2 1493
野性不改
野性不改 2020-12-10 08:04

How can I create a CUDA context? The first call of CUDA is slow and I want to create the context before I launch my kernel.

2条回答
  •  一向
    一向 (楼主)
    2020-12-10 08:57

    Using the runtime API: cudaDeviceSynchronize, cudaDeviceGetLimit, or anything that actually accesses the context should work.

    I'm quite certain you're not using the driver API, as it doesn't do that sort of lazy initialization, but for others' benefit the driver call would be cuCtxCreate.

提交回复
热议问题