Xcode:“没有这样的模块”嵌入式框架(Xcode: “No such module” embedded framework)
我目前在我的项目中有3个嵌入式框架:
PersistenceLayer
(仅限Swift)TransportLayer
(仅限Swift)Socket
(Objc)
PersistenceLayer
和Socket
都不引用它们之外的任何东西。 但是TransportLayer
导入PersistenceLayer
和Socket
。 奇怪的是,我可以在导入后使用PersistenceLayer
对象:import PersistenceLayer struct User : Model { ... }
Model
在PersistenceLayer
定义,Xcode允许我按正常使用它。 但是,当我尝试构建TransportLayer
,我得到错误:No such Modul 'Persistencelayer'
。 所以Xcode识别模块在那里,但在构建时以某种方式“丢失”它。令人抓狂的是,这曾经起作用。 在某些时候,一些事情发生了变化,我无法弄清楚是什么。 重要的是要注意我在一个有多个开发人员的项目上工作,并且我已经
merged
了更改。 但是,在合并之前切换到提交不起作用。 我也尝试过:
- 将
$(SRCROOT)
(递归)添加到框架搜索路径- 从
ModuleCache
目录中删除所有内容- 清洁项目
- 清理构建文件夹
我怀疑在我的项目设置中发生了一些变化,但我无法弄清楚是什么,我检查了git差异并没有帮助(除了正常的文件添加之外,项目中没有任何真正改变的东西。
此外,
TransportLayer
成功导入并使用Socket
。 如果我删除对PersistenceLayer
的引用但保留对Socket
所有引用,我可以构建TransportLayer。有谁知道为什么会发生这种情况或如何解决它?
更新
好的,所以我从目标中删除了“违规”文件,以确保
Socket
正在工作(它是),然后将文件重新添加到目标(完全通过重置git)。 它现在建立...因为这是有道理的。 但我尝试将方案从iOS Device
更改为模拟器,它不再构建,但我得到了不同的错误:
- 在module.modulemap中:未找到
Header
PersistenceLayer-Swift.h- 另外:
Could not build Objective-C module 'Persistence Layer'
这感觉就像我在追逐随机错误......
I currently have 3 Embedded Frameworks in my project:
PersistenceLayer
(Swift only)TransportLayer
(Swift Only)Socket
(Objc)Both
PersistenceLayer
andSocket
don't reference anything outside themselves. HoweverTransportLayer
importsPersistenceLayer
andSocket
. Oddly, I can usePersistenceLayer
objects after importing:import PersistenceLayer struct User : Model { ... }
Model
is defined inPersistenceLayer
and Xcode lets me use it per normal. However, when I try to buildTransportLayer
, I get the error:No such Modul 'Persistencelayer'
. So Xcode recognizes the module is there, but somehow "looses" it when it builds.What's maddening is that this used to work. At some point something changed and I can't figure out what. It's important to note that I work on a project with multiple developers and I have
merged
in changes. However switching to a commit prior to the merge didn't work. I've also tried:
- Adding
$(SRCROOT)
(recursive) to Framework Search Paths- Deleting everything out of
ModuleCache
directory- Clean project
- Clean Build Folder
I suspect that something changed in my project settings but I can't figure out what and I've checked the git diffs didn't help (there nothing that really changed in the project aside from the normal file additions.
Also,
TransportLayer
does successfully import and useSocket
. I can build the TransportLayer if I remove references toPersistenceLayer
but keep all the references toSocket
.Does anyone know why this might be occurring or how to fix it?
Update
Ok, so I removed the "offending" files from the target to make sure
Socket
was working (it is) and then re-added the files to the target (quite literally by resetting git). It now builds... cause that makes sense. But I tried changing the Scheme fromiOS Device
to a simulator and it no longer builds, but I'm getting different errors:
- in module.modulemap:
Header
PersistenceLayer-Swift.h' not found`- Also:
Could not build Objective-C module 'Persistence Layer'
This feels like I'm chasing down random errors...
原文:https://stackoverflow.com/questions/31435891
最满意答案
从OpenCL 1.2规范中,6.12.14.4:
对于未在上述说明中指定的image_channel_data_type值或不在范围内的(x,y)坐标值(0 ...图像宽度-1,0 ...)创建的图像对象的write_imagef,write_imagei和write_imageui行为图像高度-1)分别是未定义的。
没有写入限制,而是留给用户内核代码来确保坐标有效。
From the OpenCL 1.2 specs, 6.12.14.4:
The behavior of write_imagef, write_imagei and write_imageui for image objects created with image_channel_data_type values not specified in the description above or with (x, y) coordinate values that are not in the range (0 ... image width – 1, 0 ... image height – 1), respectively, is undefined.
There is no write clamping, and it's left to the user kernel code to ensure coordinates are valid.
相关问答
更多-
如何编写OpenCL函数(How to write an OpenCL function)[2023-05-15]
你编写函数的方式,它没有做任何事情。 你只是分配指针。 你需要这个: void swap(int *a, int *b) { int temp = *a; *a = *b; *b = temp; } 据我所知,不允许使用参考参数。 The way you have written the function, it is not doing anything. You are just assigning the pointers around. You need to have t ... -
OpenCL中的HashMap?(HashMap in OpenCL?)[2022-03-30]
我认为使用开放寻址的简单哈希表实现可以满足您的要求: 就其本质而言,它存储在单个缓冲区中,因此很容易转移到内核。 然后在内核中编写getter逻辑很容易,尤其是当您不需要任何同步(只读)时。 所以,传递一个long2的缓冲区或一个struct { long key; int val; }的缓冲区struct { long key; int val; } struct { long key; int val; } 当第一项是键而第二项是值时,也传递缓冲区大小; 现在写一个常规的开放地址getter。 I th ... -
部署OpenCL应用程序?(Deploying OpenCL application?)[2022-09-19]
你的应用程序找不到clReleaseDevice的原因是你的应用程序写了OpenCL 1.2头文件,但你的机器上只有一个OpenCL 1.1运行时。 您无法在OpenCL 1.1运行时调用OpenCL 1.2 API。 我建议使用OpenCL 1.1头文件,除非您只在OpenCL 1.2设备上运行。 它将保持您的代码在OpenCL 1.1平台和设备上运行的安全。 The reason why your application can't find clReleaseDevice is because you ... -
从OpenCL 1.2规范中,6.12.14.4: 对于未在上述说明中指定的image_channel_data_type值或不在范围内的(x,y)坐标值(0 ...图像宽度-1,0 ...)创建的图像对象的write_imagef,write_imagei和write_imageui行为图像高度-1)分别是未定义的。 没有写入限制,而是留给用户内核代码来确保坐标有效。 From the OpenCL 1.2 specs, 6.12.14.4: The behavior of write_imagef, w ...
-
使用OpenACC而不是OpenCL?(Use of OpenACC over OpenCL?)[2022-12-10]
实际上,OpenACC很像OpenMP,但目标是加速设备,如GPU。 OpenACCs #pragma acc kernels不是将OpenMP #pragma parallel for并行化多线程CPU的循环,而是将包含的循环转换为在GPU上执行的内核函数。 现在手动完成的大部分工作(例如,将数据从设备传输到设备)都被编译器隐藏。 因此,您没有两个单独的编译单元。 现在这里是OpenACC的问题,我现在采用的答案非常低:没有GCC或Clang的支持。 当然有PGI和CAPS的商业解决方案,但如果没有这些其 ... -
你是对的。 OpenCL代码不能使用DLL代码,也无法进行操作系统调用。 OpenCL适用于在锁定步骤中通过独立算法运行数百或数千个线程。 Yes you are right. OpenCL code cannot use DLL code and cannot make operating system calls. OpenCL is good for running hundreds or thousands of threads through a stand-alone algorithm in ...
-
OpenCL中的复杂数字支持(Complex number support in OpenCL)[2022-08-31]
所以,因为我需要一组函数来处理OpenCL中的复数,我最终实现了一组函数。 具体而言,我需要总和和减法(平凡,可以用标准向量操作完成),乘法,除法,得到复数模,参数(或角度)和平方根。 相关维基百科文章: http://en.wikipedia.org/wiki/Complex_number#Absolute_value_and_argument http://en.wikipedia.org/wiki/Square_root#Principal_square_root_of_a_complex_numbe ... -
OpenCL clEnqueueCopyImageToBuffer with stride(OpenCL clEnqueueCopyImageToBuffer with stride)[2023-11-11]
不幸的是,OpenCL规范中没有方法允许您在缓冲区数据的步幅不等于图像宽度时直接从缓冲区创建图像。 最有效的解决方案可能是编写自己的内核来执行此操作。 不涉及编写自己的内核的最简单的解决方案是使用clEnqueueCopyBufferToImage一次复制一行。 如果你的图像足够大,那么这种技术的性能可能与手写内核相当,但是你必须尝试一下才能看到它。 我在原始答案中没有包含clEnqueueCopyBufferRect方法,因为我的第一个本能是额外的副本会破坏性能。 然而,上面的评论让我进一步思考它,我有兴 ... -
本机C ++“内核”本质上只是您希望在命令队列中执行以保留命令顺序的函数。 AFAIK在GPU上不支持它们。 如果要跨所有设备执行C ++函数,则应考虑使用cl_event回调(当status == CL_COMPLETE时)。 假设您有一个要从设备读取的缓冲区对象并传递给您的C ++函数。 你也想传递一些整数值(我使用C ++ OpenCL包装器): // First of all, we should define a struct which describes our arguments list. ...
-
write_imageui和read_imageui可以由具有相同参数的多个线程调用,没有问题。 它们在OpenCL中作为任何其他赋值操作数运行。 例如: __private float b = tanh[(global int *)a[2]]; //like read_image, reads from a global memory (global int *)a[2] = b; //like write image, writes lo a global memory 注意: 我使用了[2],注意多 ...