Skip to content

Commit

Permalink
vl_compilenn.m: cosmetic fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vedaldi committed Dec 30, 2014
1 parent af0b52f commit 21320ac
Showing 1 changed file with 5 additions and 22 deletions.
27 changes: 5 additions & 22 deletions matlab/vl_compilenn.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ function vl_compilenn( varargin )
% with the `CudaRoot` option.
%
% `CudaRoot`:: guessed automatically
% This option specifies the path to the CUDA Devkit to use
% for compilation.
% This option specifies the path to the CUDA Devkit to use
% for compilation.
%
% `EnableImreadJpeg`:: `false`
% Set true to compile `vl_imreadjpeg()`. In order to successfully
Expand Down Expand Up @@ -299,11 +299,9 @@ function vl_compilenn( varargin )
% Reset path adding the mex subdirectory just created
vl_setupnn() ;

% --------------------------------------------------------------------
% --------------------------------------------------------------------
% MEX recipe
% --------------------------------------------------------------------
% --------------------------------------------------------------------

% --------------------------------------------------------------------
function objs = mex_compile(opts, srcs, bld_dir, mex_opts)
Expand All @@ -325,11 +323,9 @@ function mex_link(opts, srcs, objs, libs, mex_dir, mex_opts)
mex(mopts{:}) ;
end

% --------------------------------------------------------------------
% --------------------------------------------------------------------
% NVCC recipe
% --------------------------------------------------------------------
% --------------------------------------------------------------------

% --------------------------------------------------------------------
function nvcc_opts = nvcc_get_opts(opts)
Expand Down Expand Up @@ -372,11 +368,9 @@ function mex_link(opts, srcs, objs, libs, mex_dir, mex_opts)
if status, error('Command %s failed.', nvcc_cmd); end;
end

% --------------------------------------------------------------------
% --------------------------------------------------------------------
% Utility functions
% --------------------------------------------------------------------
% --------------------------------------------------------------------

% --------------------------------------------------------------------
function ext = objext()
Expand All @@ -397,11 +391,11 @@ function mex_link(opts, srcs, objs, libs, mex_dir, mex_opts)
if mver <= 80200, ext = 'sh' ; else ext = 'xml' ; end
arch = computer('arch') ;
switch arch
case {'glnxa64', 'win64'}
case {'win64'}
config_dir = fullfile(matlabroot, 'toolbox', ...
'distcomp', 'gpu', 'extern', ...
'src', 'mex', 'glnxa64') ;
case {'maci64'}
'src', 'mex', arch) ;
case {'maci64', 'glnxa64'}
config_dir = fullfile(root, 'matlab', 'src', 'config') ;
end
conf_file = fullfile(config_dir, ['mex_CUDA_' arch '.' ext]);
Expand Down Expand Up @@ -525,17 +519,6 @@ function check_nvcc(cuda_root)
end
end

% --------------------------------------------------------------------
function method = guess_cuobj_method()
% --------------------------------------------------------------------
% Guess CUDA compilation method
switch computer
case 'PCWIN64', method = 'nvcc';
case 'MACI64', method = 'mex';
case 'GLNXA64', method = 'mex';
otherwise, error('Unsupported architecture %s.', computer) ;
end

% --------------------------------------------------------------------
function cudaArch = get_cuda_arch(opts)
% --------------------------------------------------------------------
Expand Down

0 comments on commit 21320ac

Please sign in to comment.