gpuNUFFT 0.7.4__tar.gz → 0.8.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. gpunufft-0.8.0/.clang-format +48 -0
  2. gpunufft-0.8.0/.gitignore +49 -0
  3. gpunufft-0.8.0/.ycm_extra_conf.py +162 -0
  4. gpunufft-0.8.0/CUDA/bin/cvp/Gridding3D.cvp +34 -0
  5. gpunufft-0.8.0/CUDA/bin/cvp/README +4 -0
  6. gpunufft-0.8.0/CUDA/bin/gtest_options +3 -0
  7. gpunufft-0.8.0/CUDA/bin/run_cpu_filtered_unit_test.cmd +1 -0
  8. gpunufft-0.8.0/CUDA/bin/run_cuda_memcheck +4 -0
  9. gpunufft-0.8.0/CUDA/bin/run_gpu_filtered_unit_test.cmd +1 -0
  10. gpunufft-0.8.0/CUDA/build/configure_double_prec +1 -0
  11. gpunufft-0.8.0/CUDA/build/configure_single_prec +1 -0
  12. gpunufft-0.8.0/CUDA/cmake_modules/FindGPUNUFFT.cmake +24 -0
  13. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/inc/gpuNUFFT_operator.hpp +14 -2
  14. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/src/gpu/python/gpuNUFFT_operator_python_factory.cpp +8 -1
  15. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/src/gpuNUFFT_operator.cpp +4 -4
  16. gpunufft-0.8.0/CUDA/test/CMakeLists.txt +30 -0
  17. gpunufft-0.8.0/CUDA/test/cpu/CMakeLists.txt +16 -0
  18. gpunufft-0.8.0/CUDA/test/cpu/gpuNUFFT_kernel_tests.cpp +27 -0
  19. gpunufft-0.8.0/CUDA/test/cpu/gpuNUFFT_operator_factory_tests.cpp +167 -0
  20. gpunufft-0.8.0/CUDA/test/cpu/gpuNUFFT_precomputation_tests.cpp +1054 -0
  21. gpunufft-0.8.0/CUDA/test/cpu/gpuNUFFT_tests.cpp +1168 -0
  22. gpunufft-0.8.0/CUDA/test/gpu/forward/gpuNUFFT_forward_tests.cpp +390 -0
  23. gpunufft-0.8.0/CUDA/test/gpu/gpuNUFFT_2D_conv_tests.cpp +1204 -0
  24. gpunufft-0.8.0/CUDA/test/gpu/gpuNUFFT_conv_tests.cpp +1670 -0
  25. gpunufft-0.8.0/CUDA/test/gpu/gpuNUFFT_deapo_tests.cpp +438 -0
  26. gpunufft-0.8.0/CUDA/test/gpu/gpuNUFFT_fft_tests.cpp +818 -0
  27. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/PKG-INFO +1 -1
  28. gpunufft-0.8.0/RELEASENOTES.txt +52 -0
  29. gpunufft-0.8.0/VERSION.txt +1 -0
  30. gpunufft-0.8.0/gpuNUFFT/@gpuNUFFT/clearGpuNUFFTMemory.m +10 -0
  31. gpunufft-0.8.0/gpuNUFFT/@gpuNUFFT/ctranspose.m +4 -0
  32. gpunufft-0.8.0/gpuNUFFT/@gpuNUFFT/gpuNUFFT.m +128 -0
  33. gpunufft-0.8.0/gpuNUFFT/@gpuNUFFT/mtimes.m +6 -0
  34. gpunufft-0.8.0/gpuNUFFT/@gpuNUFFT/private/gpuNUFFT_adj.m +55 -0
  35. gpunufft-0.8.0/gpuNUFFT/@gpuNUFFT/private/gpuNUFFT_forw.m +56 -0
  36. gpunufft-0.8.0/gpuNUFFT/@gpuNUFFT/transpose.m +4 -0
  37. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/gpuNUFFT.egg-info/PKG-INFO +1 -1
  38. gpunufft-0.8.0/gpuNUFFT.egg-info/SOURCES.txt +113 -0
  39. gpunufft-0.8.0/matlab/README +13 -0
  40. gpunufft-0.8.0/matlab/demo/cgsense_brain32ch_recon_2D.m +95 -0
  41. gpunufft-0.8.0/matlab/demo/cgsense_phantom_recon.m +79 -0
  42. gpunufft-0.8.0/matlab/demo/cgsense_phantom_recon_cpu.m +73 -0
  43. gpunufft-0.8.0/matlab/demo/data/brain_64spokes.mat +0 -0
  44. gpunufft-0.8.0/matlab/demo/data/rawdata_phantom_regridding.mat +0 -0
  45. gpunufft-0.8.0/matlab/demo/gradient_demo.m +72 -0
  46. gpunufft-0.8.0/matlab/demo/run_demo.m +43 -0
  47. gpunufft-0.8.0/matlab/demo/utils/adapt_array_2d.m +83 -0
  48. gpunufft-0.8.0/matlab/demo/utils/cg_sense_2d.m +109 -0
  49. gpunufft-0.8.0/matlab/demo/utils/cg_sense_3d.m +112 -0
  50. gpunufft-0.8.0/matlab/demo/utils/col.m +2 -0
  51. gpunufft-0.8.0/matlab/demo/utils/cpuNUFFT/@NUFFT/NUFFT.m +58 -0
  52. gpunufft-0.8.0/matlab/demo/utils/cpuNUFFT/@NUFFT/ctranspose.m +4 -0
  53. gpunufft-0.8.0/matlab/demo/utils/cpuNUFFT/@NUFFT/mtimes.m +27 -0
  54. gpunufft-0.8.0/matlab/demo/utils/cpuNUFFT/@NUFFT/times.m +19 -0
  55. gpunufft-0.8.0/matlab/demo/utils/cpuNUFFT/@NUFFT/transpose.m +4 -0
  56. gpunufft-0.8.0/matlab/demo/utils/cpuNUFFT/@NUFFT3D/NUFFT3D.m +47 -0
  57. gpunufft-0.8.0/matlab/demo/utils/cpuNUFFT/@NUFFT3D/ctranspose.m +4 -0
  58. gpunufft-0.8.0/matlab/demo/utils/cpuNUFFT/@NUFFT3D/interp3_table_adj_mex.map +0 -0
  59. gpunufft-0.8.0/matlab/demo/utils/cpuNUFFT/@NUFFT3D/mtimes.m +32 -0
  60. gpunufft-0.8.0/matlab/demo/utils/cpuNUFFT/@NUFFT3D/transpose.m +4 -0
  61. gpunufft-0.8.0/python/README.md +4 -0
  62. gpunufft-0.8.0/python/__pycache__/test_mem.cpython-310-pytest-7.4.4.pyc +0 -0
  63. gpunufft-0.8.0/python/__pycache__/test_nufftOp.cpython-310-pytest-7.4.4.pyc +0 -0
  64. gpunufft-0.8.0/python/test_mem.py +57 -0
  65. gpunufft-0.8.0/python/test_nufftOp.py +136 -0
  66. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/setup.py +1 -1
  67. gpuNUFFT-0.7.4/gpuNUFFT.egg-info/SOURCES.txt +0 -56
  68. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/CMakeLists.txt +0 -0
  69. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/doc/CMakeLists.txt +0 -0
  70. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/doc/Doxyfile +0 -0
  71. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/doc/mainpage.dox +0 -0
  72. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/inc/balanced_gpuNUFFT_operator.hpp +0 -0
  73. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/inc/balanced_operator.hpp +0 -0
  74. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/inc/balanced_texture_gpuNUFFT_operator.hpp +0 -0
  75. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/inc/config.hpp +0 -0
  76. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/inc/config.hpp.cmake +0 -0
  77. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/inc/cuda_utils.cuh +0 -0
  78. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/inc/cuda_utils.hpp +0 -0
  79. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/inc/cufft_config.hpp +0 -0
  80. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/inc/cufft_config.hpp.cmake +0 -0
  81. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/inc/gpuNUFFT_cpu.hpp +0 -0
  82. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/inc/gpuNUFFT_kernels.hpp +0 -0
  83. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/inc/gpuNUFFT_operator_factory.hpp +0 -0
  84. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/inc/gpuNUFFT_types.hpp +0 -0
  85. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/inc/gpuNUFFT_utils.hpp +0 -0
  86. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/inc/matlab_helper.h +0 -0
  87. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/inc/precomp_kernels.hpp +0 -0
  88. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/inc/precomp_utils.hpp +0 -0
  89. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/inc/texture_gpuNUFFT_operator.hpp +0 -0
  90. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/src/CMakeLists.txt +0 -0
  91. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/src/balanced_gpuNUFFT_operator.cpp +0 -0
  92. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/src/balanced_texture_gpuNUFFT_operator.cpp +0 -0
  93. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/src/cpu/gpuNUFFT_cpu.cpp +0 -0
  94. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/src/gpu/CMakeLists.txt +0 -0
  95. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/src/gpu/atomic/CMakeLists.txt +0 -0
  96. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/src/gpu/atomic/atomic_gpuNUFFT.cu +0 -0
  97. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/src/gpu/atomic/atomic_gpuNUFFT_kernels.cu +0 -0
  98. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/src/gpu/atomic/texture_gpuNUFFT_kernels.cu +0 -0
  99. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/src/gpu/matlab/CMakeLists.txt +0 -0
  100. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/src/gpu/matlab/gpuNUFFT_adj.cpp +0 -0
  101. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/src/gpu/matlab/gpuNUFFT_forw.cpp +0 -0
  102. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/src/gpu/matlab/gpuNUFFT_operator_matlabfactory.cpp +0 -0
  103. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/src/gpu/matlab/gpuNUFFT_operator_matlabfactory.hpp +0 -0
  104. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/src/gpu/matlab/precomputation/CMakeLists.txt +0 -0
  105. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/src/gpu/matlab/precomputation/gpuNUFFT_precomp.cpp +0 -0
  106. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/src/gpu/precomp_kernels.cu +0 -0
  107. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/src/gpu/python/CMakeLists.txt +0 -0
  108. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/src/gpu/std_gpuNUFFT_kernels.cu +0 -0
  109. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/src/gpuNUFFT_operator_factory.cpp +0 -0
  110. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/src/gpuNUFFT_utils.cpp +0 -0
  111. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/CUDA/src/texture_gpuNUFFT_operator.cpp +0 -0
  112. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/LICENSE +0 -0
  113. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/MANIFEST.in +0 -0
  114. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/README.md +0 -0
  115. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/gpuNUFFT.egg-info/dependency_links.txt +0 -0
  116. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/gpuNUFFT.egg-info/not-zip-safe +0 -0
  117. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/gpuNUFFT.egg-info/top_level.txt +0 -0
  118. {gpuNUFFT-0.7.4 → gpunufft-0.8.0}/setup.cfg +0 -0
@@ -0,0 +1,48 @@
1
+ ---
2
+ # BasedOnStyle: LLVM
3
+ AccessModifierOffset: -1
4
+ ConstructorInitializerIndentWidth: 2
5
+ AlignEscapedNewlinesLeft: false
6
+ AlignTrailingComments: true
7
+ AllowShortFunctionsOnASingleLine: false
8
+ AllowAllParametersOfDeclarationOnNextLine: true
9
+ AllowShortIfStatementsOnASingleLine: false
10
+ AllowShortLoopsOnASingleLine: false
11
+ AlwaysBreakTemplateDeclarations: false
12
+ AlwaysBreakBeforeMultilineStrings: false
13
+ BreakBeforeBinaryOperators: false
14
+ BreakBeforeTernaryOperators: true
15
+ BreakConstructorInitializersBeforeComma: false
16
+ BinPackParameters: true
17
+ ColumnLimit: 80
18
+ ConstructorInitializerAllOnOneLineOrOnePerLine: false
19
+ DerivePointerBinding: false
20
+ ExperimentalAutoDetectBinPacking: false
21
+ IndentCaseLabels: false
22
+ MaxEmptyLinesToKeep: 1
23
+ NamespaceIndentation: None
24
+ ObjCSpaceBeforeProtocolList: true
25
+ PenaltyBreakBeforeFirstCallParameter: 19
26
+ PenaltyBreakComment: 60
27
+ PenaltyBreakString: 1000
28
+ PenaltyBreakFirstLessLess: 120
29
+ PenaltyExcessCharacter: 1000000
30
+ PenaltyReturnTypeOnItsOwnLine: 60
31
+ PointerBindsToType: false
32
+ SpacesBeforeTrailingComments: 2
33
+ Cpp11BracedListStyle: false
34
+ Standard: Cpp11
35
+ IndentWidth: 2
36
+ TabWidth: 2
37
+ UseTab: Never
38
+ BreakBeforeBraces: Allman
39
+ IndentFunctionDeclarationAfterType: false
40
+ SpacesInParentheses: false
41
+ SpacesInAngles: false
42
+ SpaceInEmptyParentheses: false
43
+ SpacesInCStyleCastParentheses: false
44
+ SpaceAfterControlStatementKeyword: true
45
+ SpaceBeforeAssignmentOperators: true
46
+ ContinuationIndentWidth: 4
47
+ ...
48
+
@@ -0,0 +1,49 @@
1
+ # Compiled Object files
2
+ *.slo
3
+ *.lo
4
+ *.o
5
+
6
+ # Compiled Dynamic libraries
7
+ *.so
8
+ *.dylib
9
+
10
+ # Compiled Static libraries
11
+ *.lai
12
+ *.la
13
+ *.a
14
+
15
+ # others
16
+ common/
17
+ lib/
18
+ bin/
19
+ /gpuNUFFT/GPU_gpuNUFFT_3D/data/
20
+ /gpuNUFFT/GPU_gpuNUFFT_3D/functions/trash/
21
+ /gpuNUFFT/gpuNUFFT/build/
22
+ test_03/build/
23
+ gpuNUFFT/NUFFT_recon_demo_2D/kspaceRadial.mat
24
+ gpuNUFFT/gpuNUFFT/bin
25
+ *.asv
26
+ *.zip
27
+ gpuNUFFT/daten/results/
28
+ gpuNUFFT/gpuNUFFT/matlab/script.out.*
29
+ *.mexa64
30
+ *.mexw32
31
+ *.mexw64
32
+ *.m~
33
+ gpuNUFFT/bUTE/results/
34
+ gpuNUFFT/bUTE/data/
35
+ gpuNUFFT/3D_radial_bUTE_test/results/
36
+ gpuNUFFT/bUTE/script.out*
37
+ gpuNUFFT/daten/
38
+ CUDA/inc/*config.hpp
39
+ build/
40
+ *.out
41
+ *.out.*
42
+ inc/*config.hpp
43
+ *.mat
44
+ tmp/
45
+ *.swp
46
+ *.hdr
47
+ *.cfl
48
+
49
+ matlab/demo/results/
@@ -0,0 +1,162 @@
1
+ # This file is NOT licensed under the GPLv3, which is the license for the rest
2
+ # of YouCompleteMe.
3
+ #
4
+ # Here's the license text for this file:
5
+ #
6
+ # This is free and unencumbered software released into the public domain.
7
+ #
8
+ # Anyone is free to copy, modify, publish, use, compile, sell, or
9
+ # distribute this software, either in source code form or as a compiled
10
+ # binary, for any purpose, commercial or non-commercial, and by any
11
+ # means.
12
+ #
13
+ # In jurisdictions that recognize copyright laws, the author or authors
14
+ # of this software dedicate any and all copyright interest in the
15
+ # software to the public domain. We make this dedication for the benefit
16
+ # of the public at large and to the detriment of our heirs and
17
+ # successors. We intend this dedication to be an overt act of
18
+ # relinquishment in perpetuity of all present and future rights to this
19
+ # software under copyright law.
20
+ #
21
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24
+ # IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
25
+ # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
26
+ # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
27
+ # OTHER DEALINGS IN THE SOFTWARE.
28
+ #
29
+ # For more information, please refer to <http://unlicense.org/>
30
+
31
+ import os
32
+ import ycm_core
33
+
34
+ # These are the compilation flags that will be used in case there's no
35
+ # compilation database set (by default, one is not set).
36
+ # CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
37
+ flags = [
38
+ '-Wall',
39
+ '-Wextra',
40
+ '-Werror',
41
+ #'-Wc++98-compat',
42
+ '-Wno-long-long',
43
+ '-Wno-variadic-macros',
44
+ '-fexceptions',
45
+ '-DNDEBUG',
46
+ '-DUSE_CLANG_COMPLETER',
47
+ # THIS IS IMPORTANT! Without a "-std=<something>" flag, clang won't know which
48
+ # language to use when compiling headers. So it will guess. Badly. So C++
49
+ # headers will be compiled as C headers. You don't want that so ALWAYS specify
50
+ # a "-std=<something>".
51
+ # For a C project, you would set this to something like 'c99' instead of
52
+ # 'c++11'.
53
+ #'-std=c++',
54
+ # ...and the same thing goes for the magic -x option which specifies the
55
+ # language that the files to be compiled are written in. This is mostly
56
+ # relevant for c++ headers.
57
+ # For a C project, you would set this to 'c' instead of 'c++'.
58
+ '-x',
59
+ 'c++',
60
+ '-isystem',
61
+ '../BoostParts',
62
+ '-isystem',
63
+ # This path will only work on OS X, but extra paths that don't exist are not
64
+ # harmful
65
+ '/System/Library/Frameworks/Python.framework/Headers',
66
+ '-isystem',
67
+ '../llvm/include',
68
+ '-isystem',
69
+ '../llvm/tools/clang/include',
70
+ '-I',
71
+ '.',
72
+ '-I',
73
+ './ClangCompleter',
74
+ '-isystem',
75
+ './tests/gmock/gtest',
76
+ '-isystem',
77
+ './tests/gmock/gtest/include',
78
+ '-isystem',
79
+ './tests/gmock',
80
+ '-isystem',
81
+ './tests/gmock/include',
82
+ '-isystem',
83
+ '/usr/include/flycapture',
84
+ '-isystem',
85
+ './test/',
86
+ '-isystem',
87
+ './dependencies/gtest',
88
+ '-isystem',
89
+ './dependencies/gtest/include'
90
+ ]
91
+
92
+ # Set this to the absolute path to the folder (NOT the file!) containing the
93
+ # compile_commands.json file to use that instead of 'flags'. See here for
94
+ # more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html
95
+ #
96
+ # Most projects will NOT need to set this to anything; you can just change the
97
+ # 'flags' list of compilation flags. Notice that YCM itself uses that approach.
98
+ compilation_database_folder = ''
99
+
100
+ if compilation_database_folder:
101
+ database = ycm_core.CompilationDatabase( compilation_database_folder )
102
+ else:
103
+ database = None
104
+
105
+
106
+ def DirectoryOfThisScript():
107
+ return os.path.dirname( os.path.abspath( __file__ ) )
108
+
109
+
110
+ def MakeRelativePathsInFlagsAbsolute( flags, working_directory ):
111
+ if not working_directory:
112
+ return list( flags )
113
+ new_flags = []
114
+ make_next_absolute = False
115
+ path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ]
116
+ for flag in flags:
117
+ new_flag = flag
118
+
119
+ if make_next_absolute:
120
+ make_next_absolute = False
121
+ if not flag.startswith( '/' ):
122
+ new_flag = os.path.join( working_directory, flag )
123
+
124
+ for path_flag in path_flags:
125
+ if flag == path_flag:
126
+ make_next_absolute = True
127
+ break
128
+
129
+ if flag.startswith( path_flag ):
130
+ path = flag[ len( path_flag ): ]
131
+ new_flag = path_flag + os.path.join( working_directory, path )
132
+ break
133
+
134
+ if new_flag:
135
+ new_flags.append( new_flag )
136
+ return new_flags
137
+
138
+
139
+ def FlagsForFile( filename ):
140
+ if database:
141
+ # Bear in mind that compilation_info.compiler_flags_ does NOT return a
142
+ # python list, but a "list-like" StringVec object
143
+ compilation_info = database.GetCompilationInfoForFile( filename )
144
+ final_flags = MakeRelativePathsInFlagsAbsolute(
145
+ compilation_info.compiler_flags_,
146
+ compilation_info.compiler_working_dir_ )
147
+
148
+ # NOTE: This is just for YouCompleteMe; it's highly likely that your project
149
+ # does NOT need to remove the stdlib flag. DO NOT USE THIS IN YOUR
150
+ # ycm_extra_conf IF YOU'RE NOT 100% YOU NEED IT.
151
+ try:
152
+ final_flags.remove( '-stdlib=libc++' )
153
+ except ValueError:
154
+ pass
155
+ else:
156
+ relative_to = DirectoryOfThisScript()
157
+ final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to )
158
+
159
+ return {
160
+ 'flags': final_flags,
161
+ 'do_cache': True
162
+ }
@@ -0,0 +1,34 @@
1
+ <!DOCTYPE cvp>
2
+ <cvp version="4.0" >
3
+ <session>
4
+ <name>Session1</name>
5
+ <progpath>"E:/Andi/workspaces/cuda/cuda-test/gridding3D/gridding3D/bin/runGPUUnitTests.exe"</progpath>
6
+ <workdirpath>E:/Andi/workspaces/cuda/cuda-test/gridding3D/gridding3D/bin</workdirpath>
7
+ <datetime>16 Aug 2012 16:01:37</datetime>
8
+ <normalizedcounter>false</normalizedcounter>
9
+ <device multProcessorCount="2" label="Device_0" id="0" computeCapability="1.1" maxGridDim="65535 65535" GpuOverlap="0" maxPitchMem="2147483647" totalConstMem="65536" name="GeForce 9500M (GF 9400MG + GF 9200MGS)" clockFreq="1100000" L2CacheSize="0" maxRegPerBlock="8192" chip="172" maxThreadPerSM="768" maxShareMemPerBlock="16384" maxBlockDim="512 512 64" MemClockRate="1064000" asyncEngineCount="0" warpSize="32" maxThreadPerBlock="512" MemBandwidth="272384000" textureAlignment="256" >
10
+ <context totalcountercount="0" invalidcountercount="0" id="0" label="Context_0" truncatedcountercount="0" trace="0" >
11
+ <run number="2" >branch,divergent_branch,instructions,warp_serialize</run>
12
+ <run number="3" >cta_launched,gld_incoherent,gld_coherent,gst_incoherent</run>
13
+ <run number="4" >gst_coherent,local_load,local_store</run>
14
+ <run number="5" >tex_cache_hit,tex_cache_miss</run>
15
+ </context>
16
+ </device>
17
+ </session>
18
+ <session>
19
+ <name>Session2</name>
20
+ <progpath>"E:/Andi/workspaces/cuda/cuda-test/gridding3D/gridding3D/bin/runGPUUnitTests.exe"</progpath>
21
+ <workdirpath>E:/Andi/workspaces/cuda/cuda-test/gridding3D/gridding3D/bin</workdirpath>
22
+ <datetime>16 Aug 2012 19:25:24</datetime>
23
+ <normalizedcounter>false</normalizedcounter>
24
+ <device multProcessorCount="2" label="Device_0" id="0" computeCapability="1.1" maxGridDim="65535 65535" GpuOverlap="0" maxPitchMem="2147483647" totalConstMem="65536" name="GeForce 9500M (GF 9400MG + GF 9200MGS)" clockFreq="1100000" L2CacheSize="0" maxRegPerBlock="8192" chip="172" maxThreadPerSM="768" maxShareMemPerBlock="16384" maxBlockDim="512 512 64" MemClockRate="1064000" asyncEngineCount="0" warpSize="32" maxThreadPerBlock="512" MemBandwidth="272384000" textureAlignment="256" >
25
+ <context totalcountercount="0" invalidcountercount="0" id="0" label="Context_0" truncatedcountercount="0" trace="0" >
26
+ <run number="2" >branch,divergent_branch,instructions,warp_serialize</run>
27
+ <run number="3" >cta_launched,gld_incoherent,gld_coherent,gst_incoherent</run>
28
+ <run number="4" >gst_coherent,local_load,local_store</run>
29
+ <run number="5" >tex_cache_hit,tex_cache_miss</run>
30
+ </context>
31
+ </device>
32
+ </session>
33
+ </cvp>
34
+
@@ -0,0 +1,4 @@
1
+ USAGE of CUDA Visual Profiler under LINUX
2
+
3
+ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/computeprof/bin
4
+
@@ -0,0 +1,3 @@
1
+ repeat tests: --gtest_repeat=n --gtest_break_on_failure
2
+ select single tests, filter: --gtest_filter=TestGridding.GPUTest_8SectorsKernel3nDataw32
3
+ write output to xml file: --gtest_output="xml:<file name>"
@@ -0,0 +1 @@
1
+ runUnitTests.exe --gtest_filter=TestGridding.CPUTest_8SectorsKernel3nDataw32 --gtest_repeat=100 --gtest_break_on_failure
@@ -0,0 +1,4 @@
1
+ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64;
2
+
3
+ /usr/local/cuda/bin/cuda-memcheck runGPUUnitTests
4
+
@@ -0,0 +1 @@
1
+ runGPUUnitTests.exe --gtest_filter=TestGridding.GPUTest_8SectorsKernel3nDataw32 --gtest_repeat=100 --gtest_break_on_failure
@@ -0,0 +1 @@
1
+ cmake -G "Visual Studio 10" .. -DGPU_DOUBLE_PREC=ON
@@ -0,0 +1 @@
1
+ cmake -G "Visual Studio 10" ..
@@ -0,0 +1,24 @@
1
+ INCLUDE(FindPackageHandleStandardArgs)
2
+
3
+ IF (NOT DEFINED GPUNUFFT_ROOT_DIR)
4
+ MESSAGE(FATAL_ERROR "GPUNUFFT_ROOT_DIR not defined!")
5
+ ELSE()
6
+ MESSAGE("Searching for GPUNUFFT in ${GPUNUFFT_ROOT_DIR}")
7
+
8
+ SET(GPUNUFFT_IncludeSearchPaths ${GPUNUFFT_ROOT_DIR}/CUDA/inc ${GPUNUFFT_ROOT_DIR}/inc) #/usr/local/include
9
+ SET(GPUNUFFT_LibrarySearchPaths ${GPUNUFFT_ROOT_DIR}/CUDA/bin ${GPUNUFFT_ROOT_DIR}/bin) #/usr/local/lib
10
+
11
+ FIND_PATH(GPUNUFFT_INCLUDE_DIRS NAMES gpuNUFFT_operator_factory.hpp PATHS ${GPUNUFFT_IncludeSearchPaths})
12
+
13
+ FIND_LIBRARY(GPUNUFFT_LIBRARIES NAMES gpuNUFFT gpuNUFFT_ATM_f gpuNUFFT_f PATHS ${GPUNUFFT_LibrarySearchPaths})
14
+
15
+ #Handle the REQUIRED argument and set the < UPPERCASED_NAME > _FOUND variable
16
+ FIND_PACKAGE_HANDLE_STANDARD_ARGS(GPUNUFFT "Could NOT find GPUNUFFT." GPUNUFFT_LIBRARIES GPUNUFFT_INCLUDE_DIRS)
17
+ IF(GPUNUFFT_FOUND)
18
+ FIND_PACKAGE_MESSAGE(
19
+ GPUNUFFT
20
+ "Found GPUNUFFT ${GPUNUFFT_LIBRARIES}"
21
+ "[${GPUNUFFT_LIBRARIES}][${GPUNUFFT_INCLUDE_DIRS}]")
22
+ ENDIF(GPUNUFFT_FOUND)
23
+ MARK_AS_ADVANCED(GPUNUFFT_INCLUDE_DIRS GPUNUFFT_LIBRARIES)
24
+ ENDIF()
@@ -53,13 +53,13 @@ class GpuNUFFTOperator
53
53
  GpuNUFFTOperator(IndType kernelWidth, IndType sectorWidth, DType osf,
54
54
  Dimensions imgDims, bool loadKernel = true,
55
55
  OperatorType operatorType = DEFAULT,
56
- bool matlabSharedMem = false)
56
+ bool matlabSharedMem = false, bool grad_mode = false)
57
57
  : operatorType(operatorType), osf(osf), kernelWidth(kernelWidth),
58
58
  sectorWidth(sectorWidth), imgDims(imgDims), gpuMemAllocated(false),
59
59
  debugTiming(DEBUG), sens_d(NULL), crds_d(NULL), density_comp_d(NULL),
60
60
  deapo_d(NULL), gdata_d(NULL), sector_centers_d(NULL), sectors_d(NULL),
61
61
  data_indices_d(NULL), data_sorted_d(NULL), allocatedCoils(0),
62
- matlabSharedMem(matlabSharedMem)
62
+ matlabSharedMem(matlabSharedMem), grad_mode(grad_mode)
63
63
  {
64
64
  if (loadKernel)
65
65
  initKernel();
@@ -342,6 +342,14 @@ class GpuNUFFTOperator
342
342
  GpuNUFFTOutput gpuNUFFTOut);
343
343
 
344
344
  void clean_memory();
345
+
346
+ void setGradMode(bool grad_mode) {
347
+ this->grad_mode = grad_mode;
348
+ }
349
+
350
+ bool getGradMode() {
351
+ return this->grad_mode;
352
+ }
345
353
  /** \brief Check if density compensation data is available. */
346
354
  bool applyDensComp()
347
355
  {
@@ -452,6 +460,10 @@ class GpuNUFFTOperator
452
460
  */
453
461
  bool matlabSharedMem;
454
462
 
463
+ /** \brief Flag for changing the isign, mainly used for gradients
464
+ */
465
+ bool grad_mode;
466
+
455
467
  /** \brief Return Grid Width (ImageWidth * osf) */
456
468
  IndType getGridWidth()
457
469
  {
@@ -141,7 +141,7 @@ class GpuNUFFTPythonOperator
141
141
 
142
142
  // density compensation weights
143
143
  gpuNUFFT::Array<DType> density_compArray;
144
- if(density_comp == Py_None)
144
+ if(density_comp != Py_None)
145
145
  {
146
146
  density_compArray = readNumpyArray(density_comp);
147
147
  density_compArray.dim.length = trajectory_length;
@@ -291,6 +291,12 @@ class GpuNUFFTPythonOperator
291
291
  gpuNUFFTOp->clean_memory();
292
292
  }
293
293
 
294
+ void toggle_grad_mode()
295
+ {
296
+ bool current_mode = gpuNUFFTOp->getGradMode();
297
+ gpuNUFFTOp->setGradMode(!current_mode);
298
+ }
299
+
294
300
  void set_smaps(py::array_t<std::complex<DType>> sense_maps)
295
301
  {
296
302
  CAST_POINTER_VARNAME(sense_maps, sensArray);
@@ -436,6 +442,7 @@ PYBIND11_MODULE(gpuNUFFT, m) {
436
442
  .def("clean_memory", &GpuNUFFTPythonOperator::clean_memory)
437
443
  .def("estimate_density_comp", &GpuNUFFTPythonOperator::estimate_density_comp, py::arg("max_iter") = 10)
438
444
  .def("set_smaps", &GpuNUFFTPythonOperator::set_smaps)
445
+ .def("toggle_grad_mode", &GpuNUFFTPythonOperator::toggle_grad_mode)
439
446
  .def("get_spectral_radius", &GpuNUFFTPythonOperator::get_spectral_radius, py::arg("max_iter") = 20, py::arg("tolerance") = 1e-6);
440
447
  }
441
448
  #endif // GPUNUFFT_OPERATOR_PYTHONFACTORY_H_INCLUDED
@@ -1026,7 +1026,7 @@ void gpuNUFFT::GpuNUFFTOperator::performForwardGpuNUFFT(
1026
1026
  {
1027
1027
  if ((err = pt2CufftExec(fft_plan, gdata_d + c * gi_host->gridDims_count,
1028
1028
  gdata_d + c * gi_host->gridDims_count,
1029
- CUFFT_FORWARD)) != CUFFT_SUCCESS)
1029
+ grad_mode?CUFFT_INVERSE:CUFFT_FORWARD)) != CUFFT_SUCCESS)
1030
1030
  {
1031
1031
  fprintf(stderr, "cufft has failed with err %i \n", err);
1032
1032
  showMemoryInfo(true, stderr);
@@ -1037,7 +1037,7 @@ void gpuNUFFT::GpuNUFFTOperator::performForwardGpuNUFFT(
1037
1037
  if (DEBUG && (cudaStreamSynchronize(new_stream) != cudaSuccess))
1038
1038
  printf("error at thread synchronization 5: %s\n",
1039
1039
  cudaGetErrorString(cudaGetLastError()));
1040
- performFFTShift(gdata_d, FORWARD, getGridDims(), gi_host);
1040
+ performFFTShift(gdata_d, grad_mode?INVERSE:FORWARD, getGridDims(), gi_host);
1041
1041
 
1042
1042
  if (DEBUG && (cudaStreamSynchronize(new_stream) != cudaSuccess))
1043
1043
  printf("error at thread synchronization 6: %s\n",
@@ -1240,7 +1240,7 @@ void gpuNUFFT::GpuNUFFTOperator::performForwardGpuNUFFT(
1240
1240
  {
1241
1241
  if ((err = pt2CufftExec(fft_plan, gdata_d + c * gi_host->gridDims_count,
1242
1242
  gdata_d + c * gi_host->gridDims_count,
1243
- CUFFT_FORWARD)) != CUFFT_SUCCESS)
1243
+ grad_mode?CUFFT_INVERSE:CUFFT_FORWARD)) != CUFFT_SUCCESS)
1244
1244
  {
1245
1245
  fprintf(stderr, "cufft has failed with err %i \n", err);
1246
1246
  showMemoryInfo(true, stderr);
@@ -1251,7 +1251,7 @@ void gpuNUFFT::GpuNUFFTOperator::performForwardGpuNUFFT(
1251
1251
  if (DEBUG && (cudaStreamSynchronize(new_stream) != cudaSuccess))
1252
1252
  printf("error at thread synchronization 5: %s\n",
1253
1253
  cudaGetErrorString(cudaGetLastError()));
1254
- performFFTShift(gdata_d, FORWARD, getGridDims(), gi_host);
1254
+ performFFTShift(gdata_d, grad_mode?INVERSE:FORWARD, getGridDims(), gi_host);
1255
1255
 
1256
1256
  if (DEBUG && (cudaStreamSynchronize(new_stream) != cudaSuccess))
1257
1257
  printf("error at thread synchronization 6: %s\n",
@@ -0,0 +1,30 @@
1
+ #setup testframework
2
+ MESSAGE("------setting up testframework-------")
3
+
4
+ set(GTEST_DIR "${CMAKE_SOURCE_DIR}/../../gtest/googletest")
5
+ MESSAGE("GTEST_DIR " ${GTEST_DIR})
6
+
7
+ include_directories("${GTEST_DIR}/include")
8
+
9
+ find_library(GTEST_LIB NAMES gtest libgtest HINTS "${GTEST_DIR}/build" "${GTEST_DIR}/build/Debug")
10
+ find_library(GTESTMAIN_LIB NAMES gtest_main libgtest_main HINTS "${GTEST_DIR}/build" "${GTEST_DIR}/build/Debug")
11
+
12
+ MESSAGE("GTEST_LIB = ${GTEST_LIB}")
13
+ MESSAGE("GTESTMAIN_LIB = ${GTESTMAIN_LIB}")
14
+
15
+ #gpu test sources
16
+ set(GPU_SOURCES gpu/gpuNUFFT_conv_tests.cpp
17
+ gpu/gpuNUFFT_2D_conv_tests.cpp
18
+ gpu/gpuNUFFT_fft_tests.cpp
19
+ gpu/gpuNUFFT_deapo_tests.cpp
20
+ gpu/forward/gpuNUFFT_forward_tests.cpp)
21
+
22
+ #add CPU Tests
23
+ add_subdirectory(cpu)
24
+
25
+ cuda_add_executable(runGPUATMUnitTests ${GPU_SOURCES} ${GPUNUFFT_SOURCES} ../inc/gpuNUFFT_utils.hpp ../inc/gpuNUFFT_operator_factory.hpp ../inc/gpuNUFFT_operator.hpp ../inc/gpuNUFFT_kernels.hpp)
26
+ if(WIN32)
27
+ target_link_libraries(runGPUATMUnitTests ${GRID_LIB_ATM_NAME} ${GTEST_LIB} ${GTESTMAIN_LIB})
28
+ else(WIN32)
29
+ target_link_libraries(runGPUATMUnitTests pthread ${GRID_LIB_ATM_NAME} ${GTEST_LIB} ${GTESTMAIN_LIB})
30
+ endif(WIN32)
@@ -0,0 +1,16 @@
1
+ #setup testframework
2
+ MESSAGE("------ generating cpu tests -------")
3
+
4
+ #cpu test sources
5
+ set(CPU_SOURCES gpuNUFFT_tests.cpp
6
+ gpuNUFFT_kernel_tests.cpp
7
+ gpuNUFFT_precomputation_tests.cpp
8
+ gpuNUFFT_operator_factory_tests.cpp
9
+ ../../src/gpuNUFFT_utils.cpp
10
+ ../../src/cpu/gpuNUFFT_cpu.cpp)
11
+
12
+ include_directories(${CUDA_INCLUDE_DIRS})
13
+ #add source dir
14
+ add_executable(runUnitTests ${CPU_SOURCES} ${GPUNUFFT_SOURCES} ../../inc/gpuNUFFT_cpu.hpp ../../inc/gpuNUFFT_utils.hpp ../../inc/gpuNUFFT_operator_factory.hpp ../../inc/gpuNUFFT_operator.hpp ../../inc/gpuNUFFT_kernels.hpp)
15
+ target_link_libraries(runUnitTests ${GRID_LIB_ATM_NAME} ${GTEST_LIB} ${GTESTMAIN_LIB})
16
+ set_target_properties(runUnitTests PROPERTIES LINK_FLAGS -lpthread)
@@ -0,0 +1,27 @@
1
+ #include <limits.h>
2
+ #include "gpuNUFFT_cpu.hpp"
3
+
4
+ #include "gtest/gtest.h"
5
+
6
+ #define epsilon 0.0001f
7
+
8
+ TEST(TestKernel, LoadKernel) {
9
+ if (DEBUG)
10
+ printf("start creating kernel...\n");
11
+ long kernel_entries = calculateGrid3KernelSize();
12
+
13
+ assert(kernel_entries > 0);
14
+
15
+ DType *kern = (DType*) calloc(kernel_entries,sizeof(DType));
16
+ if (kern != NULL)
17
+ {
18
+ loadGrid3Kernel(kern,kernel_entries);
19
+ EXPECT_EQ(1.0f,kern[0]);
20
+ EXPECT_LT(0.9940f-kern[1],epsilon);
21
+ EXPECT_LT(0.0621f-kern[401],epsilon);
22
+ EXPECT_LT(0.0041f-kern[665],epsilon);
23
+ EXPECT_EQ(0.0f,kern[kernel_entries-1]);
24
+ free(kern);
25
+ }
26
+ EXPECT_EQ(1, 1);
27
+ }