[Phi] fixing compilation error from _mm512_set1_epi32 and fixing zlint
Mirror Gitea refs to GitHub / mirror (push) Successful in 19s
Test / build_and_test (push) Successful in 3m13s
Build / build (push) Successful in 5m5s

issue
This commit is contained in:
2026-08-18 03:16:04 +02:00
parent d5a794aa64
commit 8360d8edfe
4 changed files with 22 additions and 6 deletions
+1 -1
View File
@@ -67,7 +67,7 @@ pub fn create(device: *PhiDevice, allocator: std.mem.Allocator, size: vk.DeviceS
errdefer device.interface.device_allocator.allocator().free(backing); errdefer device.interface.device_allocator.allocator().free(backing);
const offset = device.transport.registerHostMemory(backing) catch return VkError.OutOfHostMemory; const offset = device.transport.registerHostMemory(backing) catch return VkError.OutOfHostMemory;
errdefer device.transport.unregisterHostMemory(offset, backing.len) catch {}; errdefer device.transport.unregisterHostMemory(offset, backing.len) catch @panic("Caught an error while handling an error");
const request: proto.PhiMapHostMemoryRequest = .{ const request: proto.PhiMapHostMemoryRequest = .{
.scif_offset = offset, .scif_offset = offset,
+1 -1
View File
@@ -71,7 +71,7 @@ int HandleNewMemory(PhiEndpoint endpoint, const PhiMessageHeader* header)
return SendReply(endpoint, header, &reply, sizeof(reply)); return SendReply(endpoint, header, &reply, sizeof(reply));
} }
Memory* memory; Memory* memory = NULL;
if(header->type == PHI_PACKET_ALLOC_MEMORY) if(header->type == PHI_PACKET_ALLOC_MEMORY)
{ {
+6 -4
View File
@@ -1,10 +1,12 @@
#include <immintrin.h> #include <immintrin.h>
#include <stdint.h> #include <stdint.h>
#include <avx/Intrinsic.h>
// Dst must be 64-byte aligned // Dst must be 64-byte aligned
void PhiFill256KNC(void* dst, uint32_t value) void AvxFill256(void* dst, uint32_t value)
{ {
__m512i v = _mm512_set1_epi32((int)value); __m512i v = _mm512_set1_epi32_knc((int)value);
uint8_t* d = (uint8_t*)dst; uint8_t* d = (uint8_t*)dst;
@@ -15,9 +17,9 @@ void PhiFill256KNC(void* dst, uint32_t value)
} }
// Dst must be 64-byte aligned // Dst must be 64-byte aligned
void PhiFill64KNC(void* dst, uint32_t value) void AvxFill64(void* dst, uint32_t value)
{ {
__m512i v = _mm512_set1_epi32((int)value); __m512i v = _mm512_set1_epi32_knc((int)value);
_mm512_store_epi32(dst, v); _mm512_store_epi32(dst, v);
} }
+14
View File
@@ -0,0 +1,14 @@
#ifndef APE_PHI_AVX_INTRINSIC_H
#define APE_PHI_AVX_INTRINSIC_H
#include <immintrin.h>
#include <stdint.h>
static inline __attribute__((always_inline)) __m512i _mm512_set1_epi32_knc(uint32_t value)
{
__m512i result;
__asm__("vpbroadcastd %1, %0" : "=x"(result) : "m"(value));
return result;
}
#endif