2016-11-13 123 views
-1

我的內核包含一些專用變長數組。內核可以在Mac中編譯和執行,但在Linux OpenCL中失敗。在linux中,錯誤是error: variable length arrays are not supported in OpenCL。那麼,如何在Linux OpenCL中支持變長數組呢?如何在OpenCL linux中支持可變長度數組

+0

通必要的n值由值到內核字符串,而不是名稱,以便它成爲__local float數組[12345]而不是__local float array [n]。如果這已經生效,那麼你應該從opencl api查詢最大大小。 –

回答