You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: StationaryDist_FHorz_Case1_Simulation_noz_e_raw.m
    path of file: ./repos/VFIToolkit-matlab/StationaryDist/FHorz
    
    the code of the file until where you have to start completion: function StationaryDistKron=StationaryDist_FHorz_Case1_Simulation_noz_e_raw(jequaloneDistKron,AgeWeightParamNames,PolicyIndexesKron,N_d,N_a,N_e,N_j,pi_e_J, Parameters, simoptions)
% Simulates path based on PolicyIndexes of length 'periods' after a burn
% in of length 'burnin' (burn-in are the initial run of points that are then dropped)
%
% Options needed
%    simoptions.nsims
%    simoptions.parallel
%    simoptions.verbose
%    simoptions.ncores

    
function StationaryDistKron=StationaryDist_FHorz_Case1_Simulation_noz_e_raw(jequaloneDistKron,AgeWeightParamNames,PolicyIndexesKron,N_d,N_a,N_e,N_j,pi_e_J, Parameters, simoptions)
% Simulates path based on PolicyIndexes of length 'periods' after a burn
% in of length 'burnin' (burn-in are the initial run of points that are then dropped)
%
% Options needed
%    simoptions.nsims
%    simoptions.parallel
%    simoptions.verbose
%    simoptions.ncores

MoveSSDKtoGPU=0;
if simoptions.parallel==2
    % Simulation on GPU is really slow.
    % So instead, switch to CPU.
    % For anything but ridiculously short simulations it is more than worth the overhead to switch to CPU and back.
    PolicyIndexesKron=gather(PolicyIndexesKron);
    pi_e_J=gather(pi_e_J);
    % Use parallel cpu for these simulations
    simoptions.parallel=1;
    
    MoveSSDKtoGPU=1;
end