我正在尝试在一些文件上实现和编码,其中一些包含 SIMD 调用。我已经在服务器上编译了这段代码,运行与我的机器基本相同的操作系统,但我无法编译它。
\n\n这是错误:
\n\nmake\ng++ main.cpp -march=native -o main -fopenmp\nIn file included from /usr/lib/gcc/x86_64-linux-gnu/7/include/immintrin.h:53:0,\n from tensor.hpp:9,\n from main.cpp:4:\n/usr/lib/gcc/x86_64-linux-gnu/7/include/avx512vlintrin.h: In function \xe2\x80\x98_ZN6TensorIdE8add_avx2ERKS0_._omp_fn.5\xe2\x80\x99:\n/usr/lib/gcc/x86_64-linux-gnu/7/include/avx512vlintrin.h:447:1: error: inlining failed in call to always_inline \xe2\x80\x98__m256d _mm256_mask_add_pd(__m256d, __mmask8, __m256d, __m256d)\xe2\x80\x99: target specific option mismatch\n _mm256_mask_add_pd (__m256d __W, __mmask8 __U, __m256d __A,\n ^~~~~~~~~~~~~~~~~~\nIn file included from main.cpp:4:0:\ntensor.hpp:228:33: note: called from here\n res = _mm256_mask_add_pd(tmp, 0xFF, _mm256_mask_loadu_pd(tmp, 0xFF, &elements[i]), _mm256_mask_loadu_pd(tmp, 0xFF, &a.elements[i]));\n ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nIn file included from /usr/lib/gcc/x86_64-linux-gnu/7/include/immintrin.h:53:0,\n from tensor.hpp:9,\n from main.cpp:4:\n/usr/lib/gcc/x86_64-linux-gnu/7/include/avx512vlintrin.h:610:1: error: inlining failed in call to …Run Code Online (Sandbox Code Playgroud) 有了这段代码,为什么 navigationBarItem 没有显示出来?该视图在工作表中被调用,但这在之前并不重要......
struct ChangePasswordView: View {
@Environment(\.presentationMode) private var presentationMode
@State private var passwordNew = ""
@State private var passwordNewAgain = ""
var body: some View {
ScrollView {
changePassword
}
.navigationBarItems(leading: backButton)
.navigationBarItems(trailing: finishButton)
}
var backButton: some View {
Button(action: { self.presentationMode.wrappedValue.dismiss() }) {
Text("Cancel")
}
}
var finishButton: some View {
Button(action: {
self.changePasswordGlobally()
self.presentationMode.wrappedValue.dismiss()
}) {
Text("Apply")
}
.disabled(self.passwordNew.isEmpty || self.passwordNew != self.passwordNewAgain)
.disableAutocorrection(true)
}
}
Run Code Online (Sandbox Code Playgroud)
正如您在以下屏幕截图中看到的那样,应该引导的 navigationBarItem 没有显示: