File tree Expand file tree Collapse file tree 3 files changed +16
-4
lines changed
Expand file tree Collapse file tree 3 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 11function y = invsatlin(x ,u0 )
2- y = zeros(size(x ));
2+
3+ if isa(x ,' gpuArray' )
4+ y = zeros(size(x ), ' gpuArray' );
5+ else
6+ y = zeros(size(x ));
7+ end
38
49 y(x <= 0 ) = - u0 ;
510 y(x >= 1 ) = u0 ;
Original file line number Diff line number Diff line change 11function y = satlin(x ,u0 )
2- y = zeros(size(x ));
2+
3+ if isa(x ,' gpuArray' )
4+ y = zeros(size(x ), ' gpuArray' );
5+ else
6+ y = zeros(size(x ));
7+ end
38 y(x >-u0 & x < u0 ) = 0.5 * (x(x >-u0 & x < u0 )./u0 + 1 );
49 y(x >= u0 ) = 1 ;
10+
511end
Original file line number Diff line number Diff line change 8080 if ~isSaddle
8181 V = incorporateResults(net ,V ,iter ,timeID );
8282 end
83+
8384
8485end
8586
565566 sumV = sum(sumVcol );
566567
567568 % $E(t + \Delta t) = E(t) - S_{1}\Delta t + \frac{1}{2}S_{2}\Delta t^{2}$
568- if strcmp(net .Setting .ExecutionEnvironment ,' GPU ' )
569+ if strcmp(net .Setting .ExecutionEnvironment ,' gpu ' )
569570 S1 = gather(S1 );
570571 S2 = gather(S2 );
571572 dt = gather(dt );
589590 end
590591 end
591592
592- if strcmp(net .Setting .ExecutionEnvironment ,' GPU ' ) && nargout > 1
593+ if strcmp(net .Setting .ExecutionEnvironment ,' gpu ' ) && nargout > 1
593594 V = gather(V );
594595 U = gather(U );
595596 iter = gather(iter );
You can’t perform that action at this time.
0 commit comments