@@ -137,7 +137,7 @@ function ExaModels.ExaModel(
137137end
138138
139139function _conaug_structure! (backend, cons, sparsity)
140- kers (backend)(sparsity, cons. f, cons. itr, cons. oa; ndrange = size (cons. itr))
140+ kers (backend)(sparsity, cons. f, cons. itr, cons. oa; ndrange = length (cons. itr))
141141 _conaug_structure! (backend, cons. inner, sparsity)
142142 synchronize (backend)
143143end
@@ -214,7 +214,7 @@ function ExaModels.obj(
214214 end
215215end
216216function _obj (backend, objbuffer, obj, x)
217- kerf (backend)(objbuffer, obj. f, obj. itr, x; ndrange = size (obj. itr))
217+ kerf (backend)(objbuffer, obj. f, obj. itr, x; ndrange = length (obj. itr))
218218 _obj (backend, objbuffer, obj. inner, x)
219219 synchronize (backend)
220220end
@@ -240,7 +240,7 @@ function ExaModels.cons_nln!(
240240 end
241241end
242242function _cons_nln! (backend, y, con:: ExaModels.Constraint , x)
243- kerf (backend)(y, con. f, con. itr, x; ndrange = size (con. itr))
243+ kerf (backend)(y, con. f, con. itr, x; ndrange = length (con. itr))
244244 _cons_nln! (backend, y, con. inner, x)
245245 synchronize (backend)
246246end
252252
253253
254254function _conaugs! (backend, y, con:: ExaModels.ConstraintAug , x)
255- kerf2 (backend)(y, con. f, con. itr, x, con. oa; ndrange = size (con. itr))
255+ kerf2 (backend)(y, con. f, con. itr, x, con. oa; ndrange = length (con. itr))
256256 _conaugs! (backend, y, con. inner, x)
257257 synchronize (backend)
258258end
@@ -477,8 +477,9 @@ function ExaModels.sgradient!(
477477 f,
478478 x,
479479 adj,
480- ) where {B<: KernelAbstractions.Backend }
481- return kerg (backend)(y, f. f, f. itr, x, adj; ndrange = size (f. itr))
480+ ) where {B<: KernelAbstractions.Backend }
481+
482+ return kerg (backend)(y, f. f, f. itr, x, adj; ndrange = length (f. itr))
482483end
483484
484485function ExaModels. sjacobian! (
@@ -489,7 +490,7 @@ function ExaModels.sjacobian!(
489490 x,
490491 adj,
491492) where {B<: KernelAbstractions.Backend }
492- return kerj (backend)(y1, y2, f. f, f. itr, x, adj; ndrange = size (f. itr))
493+ return kerj (backend)(y1, y2, f. f, f. itr, x, adj; ndrange = length (f. itr))
493494end
494495
495496function ExaModels. shessian! (
@@ -501,7 +502,7 @@ function ExaModels.shessian!(
501502 adj,
502503 adj2,
503504) where {B<: KernelAbstractions.Backend }
504- return kerh (backend)(y1, y2, f. f, f. itr, x, adj, adj2; ndrange = size (f. itr))
505+ return kerh (backend)(y1, y2, f. f, f. itr, x, adj, adj2; ndrange = length (f. itr))
505506end
506507
507508function ExaModels. shessian! (
@@ -513,13 +514,13 @@ function ExaModels.shessian!(
513514 adj:: V ,
514515 adj2,
515516) where {B<: KernelAbstractions.Backend ,V<: AbstractVector }
516- return kerh2 (backend)(y1, y2, f. f, f. itr, x, adj, adj2; ndrange = size (f. itr))
517+ return kerh2 (backend)(y1, y2, f. f, f. itr, x, adj, adj2; ndrange = length (f. itr))
517518end
518519
519520@kernel function kerh (y1, y2, @Const (f), @Const (itr), @Const (x), @Const (adj1), @Const (adj2))
520521 I = @index (Global)
521522 @inbounds ExaModels. hrpass0 (
522- f. f (ExaModels . idx ( itr, I) , ExaModels. SecondAdjointNodeSource (x)),
523+ f. f (itr[I] , ExaModels. SecondAdjointNodeSource (x)),
523524 f. comp2,
524525 y1,
525526 y2,
541542)
542543 I = @index (Global)
543544 @inbounds ExaModels. hrpass0 (
544- f. f (ExaModels . idx ( itr, I) , ExaModels. SecondAdjointNodeSource (x)),
545+ f. f (itr[I] , ExaModels. SecondAdjointNodeSource (x)),
545546 f. comp2,
546547 y1,
547548 y2,
555556@kernel function kerj (y1, y2, @Const (f), @Const (itr), @Const (x), @Const (adj))
556557 I = @index (Global)
557558 @inbounds ExaModels. jrpass (
558- f. f (ExaModels . idx ( itr, I) , ExaModels. AdjointNodeSource (x)),
559+ f. f (itr[I] , ExaModels. AdjointNodeSource (x)),
559560 f. comp1,
560561 ExaModels. offset0 (f, itr, I),
561562 y1,
569570@kernel function kerg (y, @Const (f), @Const (itr), @Const (x), @Const (adj))
570571 I = @index (Global)
571572 @inbounds ExaModels. grpass (
572- f. f (ExaModels . idx ( itr, I) , ExaModels. AdjointNodeSource (x)),
573+ f. f (itr[I] , ExaModels. AdjointNodeSource (x)),
573574 f. comp1,
574575 y,
575576 ExaModels. offset1 (f, I),
@@ -580,11 +581,11 @@ end
580581
581582@kernel function kerf (y, @Const (f), @Const (itr), @Const (x))
582583 I = @index (Global)
583- @inbounds y[ExaModels. offset0 (f, itr, I)] = f. f (ExaModels . idx ( itr, I) , x)
584+ @inbounds y[ExaModels. offset0 (f, itr, I)] = f. f (itr[I] , x)
584585end
585586@kernel function kerf2 (y, @Const (f), @Const (itr), @Const (x), @Const (oa))
586587 I = @index (Global)
587- @inbounds y[oa+ I] = f. f (ExaModels . idx ( itr, I) , x)
588+ @inbounds y[oa+ I] = f. f (itr[I] , x)
588589end
589590
590591
0 commit comments