@@ -65,6 +65,13 @@ static_assert(K_QUANTS_PER_ITERATION == 1 || K_QUANTS_PER_ITERATION == 2, "K_QUA
6565#define VK_LOG_DEBUG (msg ) ((void ) 0 )
6666#endif // GGML_VULKAN_DEBUG
6767
68+ #ifdef GGML_VULKAN_V1_2_162
69+ #ifdef VK_NULL_HANDLE
70+ #undef VK_NULL_HANDLE
71+ #define VK_NULL_HANDLE nullptr
72+ #endif // VK_NULL_HANDLE
73+ #endif // GGML_VULKAN_V1_2_162
74+
6875struct ggml_backend_vk_context ;
6976
7077struct vk_queue {
@@ -865,6 +872,16 @@ static void ggml_vk_submit(vk_context& ctx, vk::Fence fence) {
865872 tl_signal_vals[idx].push_back (submission.signal_semaphores [i].value );
866873 tl_signal_semaphores[idx].push_back (submission.signal_semaphores [i].s );
867874 }
875+ #if defined(GGML_VULKAN_V1_2_162)
876+ vk::TimelineSemaphoreSubmitInfo timeline_info (
877+ (uint32_t ) submission.wait_semaphores .size (),
878+ tl_wait_vals[idx].data (),
879+ (uint32_t ) submission.signal_semaphores .size (),
880+ tl_signal_vals[idx].data ()
881+ );
882+ timeline_info.setPNext (nullptr );
883+ tl_submit_infos.push_back (timeline_info);
884+ #else
868885 tl_submit_infos.push_back ({
869886 (uint32_t ) submission.wait_semaphores .size (),
870887 tl_wait_vals[idx].data (),
@@ -873,6 +890,7 @@ static void ggml_vk_submit(vk_context& ctx, vk::Fence fence) {
873890 });
874891 tl_submit_infos[idx].sType = vk::StructureType::eTimelineSemaphoreSubmitInfo;
875892 tl_submit_infos[idx].pNext = nullptr ;
893+ #endif
876894 vk::SubmitInfo si{
877895 (uint32_t ) submission.wait_semaphores .size (),
878896 tl_wait_semaphores[idx].data (),
@@ -1846,22 +1864,28 @@ static vk_device ggml_vk_get_device(size_t idx) {
18461864
18471865 vk::PhysicalDeviceProperties2 props2;
18481866 vk::PhysicalDeviceMaintenance3Properties props3;
1867+ #ifndef GGML_VULKAN_V1_2_162
18491868 vk::PhysicalDeviceMaintenance4Properties props4;
1869+ #endif // GGML_VULKAN_V1_2_162
18501870 vk::PhysicalDeviceSubgroupProperties subgroup_props;
18511871 props2.pNext = &props3;
18521872 props3.pNext = &subgroup_props;
1873+ #ifndef GGML_VULKAN_V1_2_162
18531874 if (maintenance4_support) {
18541875 subgroup_props.pNext = &props4;
18551876 }
1877+ #endif // GGML_VULKAN_V1_2_162
18561878 device->physical_device .getProperties2 (&props2);
18571879 device->properties = props2.properties ;
18581880
18591881 const char * GGML_VK_FORCE_MAX_ALLOCATION_SIZE = getenv (" GGML_VK_FORCE_MAX_ALLOCATION_SIZE" );
18601882
18611883 if (GGML_VK_FORCE_MAX_ALLOCATION_SIZE != nullptr ) {
18621884 device->max_memory_allocation_size = std::stoi (GGML_VK_FORCE_MAX_ALLOCATION_SIZE);
1885+ #ifndef GGML_VULKAN_V1_2_162
18631886 } else if (maintenance4_support) {
18641887 device->max_memory_allocation_size = std::min (props3.maxMemoryAllocationSize , props4.maxBufferSize );
1888+ #endif // GGML_VULKAN_V1_2_162
18651889 } else {
18661890 device->max_memory_allocation_size = props3.maxMemoryAllocationSize ;
18671891 }
0 commit comments