 
       (enq-map-buffer* queue cl-data true 0 CL/CL_WRITE (events ev-nd) ev-map)
   "
-  [queue cl blocking offset flags ^objects wait-events event]
+  [queue cl blocking offset flags ^objects wait-events event] ;;TODO size probably overflows!!!!!
   (let [err (int-array 1)
         res (CL/clEnqueueMapBuffer queue (cl-mem cl) blocking flags offset
                                    (size cl)

  ([^long size]
   (svm-buffer* *context* size 0 0)))

(extend-type Number
  Argument
  (set-arg [this kernel n]
    (with-check (CL/clSetKernelArg kernel n (long this) nil)
      kernel)))

(extend-type (Class/forName "[F")

  ([queue cl host blocking offset ^objects wait-events event]
   (with-check
     (CL/clEnqueueWriteBuffer queue (cl-mem cl) blocking offset
                              (min (size cl) (size host)) (ptr host)
                              (if wait-events (alength wait-events) 0)
                              wait-events event)
     queue))
