 (defn info-local-mem-size [device]
   (info-long* CL/clGetDeviceInfo device CL/CL_DEVICE_LOCAL_MEM_SIZE))
 
-;;TODO
 (defn info-local-mem-type [device]
-  (info-long* CL/clGetDeviceInfo device CL/CL_DEVICE_LOCAL_MEM_TYPE))
+  (info-mask-one* CL/clGetDeviceInfo device
+                  CL/CL_DEVICE_LOCAL_MEM_TYPE
+                  mem-type-table))
 
 (defn info-max-clock-frequency [device]
   (info-int* CL/clGetDeviceInfo device CL/CL_DEVICE_MAX_CLOCK_FREQUENCY))

   :extensions CL/CL_PLATFORM_EXTENSIONS
   :icd-suffix-khr CL/CL_PLATFORM_ICD_SUFFIX_KHR})

(def context-prop-names
  {:platform CL/CL_CONTEXT_PLATFORM
   :interop-user-sync CL/CL_CONTEXT_INTEROP_USER_SYNC
   :gl CL/CL_GL_CONTEXT_KHR

  (info-bool* CL/clGetDeviceInfo device CL/CL_DEVICE_AVAILABLE))

(defn info-built-in-kernels [device]
  (let [res (info-string* CL/clGetDeviceInfo device
                          CL/CL_DEVICE_BUILT_IN_KERNELS)]
    (if (str/blank? res)
      []
      (str/split res #" "))))

(defn info-compiler-available [device]
  (info-bool* CL/clGetDeviceInfo device CL/CL_DEVICE_COMPILER_AVAILABLE))

(defn info-double-fp-config [device]
  (info-mask* CL/clGetDeviceInfo device
              CL/CL_DEVICE_DOUBLE_FP_CONFIG
              fp-config-table))

(defn info-endian-little [device]
  (info-bool* CL/clGetDeviceInfo device CL/CL_DEVICE_ENDIAN_LITTLE))
