remove trailing NULL from values returned from NVRTC
@@ -120,6 +120,9 @@ cpdef unicode getPTX(size_t prog):
with nogil:
status = nvrtcGetPTX(<Program>prog, ptx_ptr)
check_status(status)
+
+ # Strip the trailing NULL.
+ ptx = ptx[:-1]
return ptx.decode('UTF-8')
@@ -135,4 +138,7 @@ cpdef unicode getProgramLog(size_t prog):
with nogil:
status = nvrtcGetProgramLog(<Program>prog, log_ptr)
check_status(status)
+
+ # Strip the trailing NULL.
+ log = log[:-1]
return log.decode('UTF-8')
