cmxExtract_cpu (Calls: 1, Time: 0.027 sec)
Generated 28-May-2016 14:58:44 using performance time.
function in file /home/johs/work/clustering/src/cmxExtract_cpu.m
Copy to new window for comparing multiple runs
Function Name | Function Type | Calls |
AMoG_cpu | function | 1 |
Line Number | Code | Calls | Total Time | % Time | Time Plot |
32 | dims(numel(dims)+1) = str2num(... | 1 | 0.010 s | 36.3% | ![]() |
2 | [~,~,fileSuffix] = fileparts(f... | 1 | 0.005 s | 18.1% | ![]() |
35 | dims(numel(dims)+1) = str2num(... | 1 | 0.002 s | 6.3% | ![]() |
37 | nbytePerElement = (str2num(af_... | 1 | 0.001 s | 4.4% | ![]() |
31 | for i = dim_separators | 1 | 0.001 s | 3.7% | ![]() |
All other lines | 0.008 s | 31.2% | ![]() | ||
Totals | 0.027 s | 100% |
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
str2num | function | 3 | 0.005 s | 20.1% | ![]() |
fileparts | function | 1 | 0.004 s | 15.0% | ![]() |
Self time (built-ins, overhead, etc.) | 0.017 s | 64.9% | ![]() | ||
Totals | 0.027 s | 100% |
Line number | Message |
32 | The variable 'dims' appears to change size on every loop iteration. Consider preallocating for speed. |
32 | If you are operating on scalar values, consider using STR2DOUBLE for faster performance. |
35 | If you are operating on scalar values, consider using STR2DOUBLE for faster performance. |
37 | If you are operating on scalar values, consider using STR2DOUBLE for faster performance. |
Total lines in function | 38 |
Non-code lines (comments, blank lines) | 8 |
Code lines (lines that can run) | 30 |
Code lines that did run | 23 |
Code lines that did not run | 7 |
Coverage (did run/can run) | 76.67 % |
time | Calls | line | |
---|---|---|---|
1 | function [type, dims, nnumberPerElement, nbytePerElement] = cmxExtract_cpu(filename) | ||
< 0.01 | 1 | 2 | [~,~,fileSuffix] = fileparts(filename); |
< 0.01 | 1 | 3 | assert(strncmp(fileSuffix, '.cm', 3)); |
4 | |||
< 0.01 | 1 | 5 | underscores = strfind(fileSuffix, '_'); |
< 0.01 | 1 | 6 | assert(numel(underscores) == 1); |
1 | 7 | startOfDims = underscores(1); | |
8 | |||
< 0.01 | 1 | 9 | af_type = fileSuffix(4:(startOfDims-1)); |
< 0.01 | 1 | 10 | dim_suffix = fileSuffix((startOfDims+1):end); |
11 | |||
1 | 12 | nnumberPerElement = 1; | |
1 | 13 | switch af_type(1) | |
< 0.01 | 1 | 14 | case 'c' |
15 | type_base='float'; | ||
16 | nnumberPerElement = 2; | ||
< 0.01 | 1 | 17 | case 'f' |
1 | 18 | type_base='float'; | |
19 | case 's' | ||
20 | type_base='int'; | ||
21 | case 'u' | ||
22 | type_base='uint'; | ||
23 | end | ||
24 | |||
< 0.01 | 1 | 25 | type = [type_base, af_type(2:end)]; |
26 | |||
< 0.01 | 1 | 27 | dim_separators = strfind(dim_suffix, 'x'); |
28 | |||
1 | 29 | dims = []; | |
1 | 30 | prev = 1; | |
< 0.01 | 1 | 31 | for i = dim_separators |
< 0.01 | 1 | 32 | dims(numel(dims)+1) = str2num(dim_suffix(prev:(i-1))); |
1 | 33 | prev = (i+1); | |
< 0.01 | 1 | 34 | end |
< 0.01 | 1 | 35 | dims(numel(dims)+1) = str2num(dim_suffix(prev:end)); |
36 | |||
< 0.01 | 1 | 37 | nbytePerElement = (str2num(af_type(2:end))/8) * nnumberPerElement; |
< 0.01 | 1 | 38 | end |