|
312 | 312 | ;; divisions division-size sbesize sbsize))
|
313 | 313 | (loop :for d :below divisions
|
314 | 314 | :do (if ;; (< *active-workers* *workers-count*)
|
315 |
| - ;; (loop :for worker :across (lparallel.kernel::workers lparallel::*kernel*) |
316 |
| - ;; :never (null (lparallel.kernel::running-category worker))) |
| 315 | + (loop :for worker :across (lparallel.kernel::workers lparallel::*kernel*) |
| 316 | + :never (null (lparallel.kernel::running-category worker))) |
317 | 317 | ;; t
|
318 |
| - (lparallel:kernel-worker-index) |
| 318 | + ;; (lparallel:kernel-worker-index) |
319 | 319 | (funcall (funcall process d))
|
320 | 320 | (progn (incf threaded-count)
|
321 | 321 | (lparallel::submit-task lpchannel (funcall process d)))))
|
|
2325 | 2325 |
|
2326 | 2326 | (defmethod prototype-of ((varray vader-mix))
|
2327 | 2327 | (let ((base-indexer (base-indexer-of varray)))
|
2328 |
| - (prototype-of (if (not (functionp base-indexer)) |
2329 |
| - base-indexer (funcall base-indexer 0))))) |
| 2328 | + (prototype-of (or (vamix-cached-elements varray) |
| 2329 | + (if (not (functionp base-indexer)) |
| 2330 | + base-indexer (funcall base-indexer 0)))))) |
2330 | 2331 |
|
2331 | 2332 | (defmethod shape-of ((varray vader-mix))
|
2332 | 2333 | (get-promised
|
|
2342 | 2343 | ((not base-shape)
|
2343 | 2344 | (setf (vamix-cached-elements varray)
|
2344 | 2345 | (funcall base-indexer 0))
|
2345 |
| - ;; (print (list :eoe (shape-of (vamix-cached-elements varray)))) |
2346 | 2346 | (shape-of (vamix-cached-elements varray)))
|
2347 | 2347 | (t
|
2348 |
| - (if (typep base 'vacomp-reduce) (print :aa)) |
2349 | 2348 | (loop :for ix :below (reduce #'* base-shape)
|
2350 | 2349 | :do (let ((member (funcall base-indexer ix)))
|
2351 | 2350 | (setf max-rank (max max-rank (length (shape-of member))))
|
2352 | 2351 | (push (shape-of member) each-shape)))
|
2353 |
| - (if (typep base 'vacomp-reduce) (print :ee)) |
2354 | 2352 | (let ((out-shape) (shape-indices)
|
2355 | 2353 | (max-shape (make-array max-rank :element-type 'fixnum :initial-element 0)))
|
2356 | 2354 | (loop :for shape :in each-shape
|
|
2361 | 2359 | (setf axis (setf (vads-axis varray)
|
2362 | 2360 | (if (eq :last axis) (length base-shape)
|
2363 | 2361 | (ceiling (- axis (vads-io varray))))))
|
2364 |
| - |
2365 |
| - (if (typep base 'vacomp-reduce) (print :dd)) |
2366 | 2362 | ;; push the outer shape elements to the complete shape
|
2367 | 2363 | (loop :for odim :in base-shape :for ix :from 0
|
2368 | 2364 | :do (when (= ix axis)
|
|
2385 | 2381 | (defmethod indexer-of ((varray vader-mix) &optional params)
|
2386 | 2382 | (get-promised
|
2387 | 2383 | (varray-indexer varray)
|
2388 |
| - (let* (;; (ee (if (typep (vader-base varray) 'vacomp-reduce) (print :cc))) |
2389 |
| - (oshape (shape-of varray)) |
| 2384 | + (let* ((oshape (shape-of varray)) |
2390 | 2385 | (ofactors (get-dimensional-factors oshape t))
|
2391 | 2386 | (oindexer (base-indexer-of varray))
|
2392 | 2387 | (dim-indices (vamix-shape-indices varray))
|
2393 | 2388 | (orank (length (shape-of (vader-base varray))))
|
2394 |
| - ;; (ee (if (typep (vader-base varray) 'vacomp-reduce) (print :dd))) |
2395 | 2389 | (outer-shape (loop :for i :in dim-indices :for s :in oshape
|
2396 | 2390 | :when (> orank i) :collect s))
|
2397 | 2391 | (inner-shape (loop :for i :in dim-indices :for s :in oshape
|
2398 | 2392 | :when (<= orank i) :collect s))
|
2399 | 2393 | (inner-rank (length inner-shape))
|
2400 | 2394 | (iofactors (get-dimensional-factors outer-shape t)))
|
2401 |
| - ;; (if (typep (vader-base varray) 'vacomp-reduce) (print :aa)) |
2402 |
| - ;; (print (list :oo oshape (shape-of (vader-base varray)) |
2403 |
| - ;; (not (shape-of (vader-base varray))))) |
2404 |
| - |
2405 | 2395 | ;; TODO: add logic to simply return the argument if it's an array containing no nested arrays
|
2406 | 2396 | (if (not oshape) ;; if the argument is a scalar
|
2407 | 2397 | (if (not (functionp oindexer)) ;; a scalar value like 5
|
2408 |
| - (lambda (index) (disclose oindexer)) |
| 2398 | + (lambda (i) (declare (ignore i)) (disclose oindexer)) |
2409 | 2399 | ;; TODO: change indexer-of for rank 0 arrays to obviate this
|
2410 | 2400 | (let* ((indexed (funcall oindexer 0))
|
2411 | 2401 | (iindexer (indexer-of indexed))
|
|
2414 | 2404 | (if (and (typep (vader-base varray) 'varray)
|
2415 | 2405 | (not (shape-of (vader-base varray))))
|
2416 | 2406 | (indexer-of (vader-base varray))
|
2417 |
| - (lambda (index) sub-index)))) |
| 2407 | + (lambda (i) (declare (ignore i)) sub-index)))) |
2418 | 2408 | (if (not (shape-of (vader-base varray)))
|
2419 | 2409 | ;; pass through the indexer of enclosed arrays as for ↑⊂2 4
|
2420 |
| - ;; (indexer-of (funcall oindexer 0)) |
2421 | 2410 | (indexer-of (vamix-cached-elements varray))
|
2422 | 2411 | (if (vamix-cached-elements varray)
|
2423 | 2412 | (progn (print (list :ce (vamix-cached-elements varray)))
|
|
2445 | 2434 | (irank (length ishape))
|
2446 | 2435 | (doffset (- inner-rank irank))
|
2447 | 2436 | (iindex 0))
|
2448 |
| - ;; (if (arrayp iarray) |
2449 |
| - ;; (print (list :ia iarray (type-of (vader-base varray)) |
2450 |
| - ;; (shape-of varray)))) |
2451 | 2437 | (if (not (functionp iindexer))
|
2452 | 2438 | (when (zerop (reduce #'+ inner-indices)) iindexer)
|
2453 | 2439 | (progn (loop :for i :in inner-indices :for ix :from 0 :while iindex
|
|
4119 | 4105 | (setq value (if (not value) item
|
4120 | 4106 | (funcall (vacmp-left varray)
|
4121 | 4107 | value item))))))
|
4122 |
| - ;; (print (list :val value (render value))) |
| 4108 | + ;; (print (list :val value)) |
4123 | 4109 | value))))))))))))
|
4124 | 4110 |
|
4125 | 4111 | ;; (flet ((process-item (ix)
|
|
0 commit comments