@@ -79,12 +79,6 @@ struct ggml_backend_kompute_context {
79
79
: device(device), name(ggml_kompute_format_name(device)) { buft.context = nullptr ; }
80
80
};
81
81
82
- // FIXME: It would be good to consolidate the kompute manager and the kompute context into one object
83
- // and consolidate the init functions and simplify object lifetime management. As it currently stands,
84
- // we *have* to have the kompute manager no matter what for device discovery, but the kompute context
85
- // is only created when a device is set and vulkan is explicitly turned on.
86
- static ggml_backend_kompute_context *s_kompute_context = nullptr ;
87
-
88
82
89
83
struct ggml_backend_kompute_buffer_type_context {
90
84
int device;
@@ -1853,35 +1847,6 @@ kp::TensorT<uint8_t>::dataType()
1853
1847
1854
1848
// backend interface
1855
1849
1856
-
1857
- static void ggml_backend_kompute_device_ref (ggml_backend_buffer_type_t buft) {
1858
- auto * ctx = static_cast <ggml_backend_kompute_buffer_type_context *>(buft->context );
1859
-
1860
- if (!ctx->device_ref ) {
1861
- s_kompute_context->manager .initializeDevice (
1862
- ctx->device , {}, {
1863
- " VK_KHR_shader_float16_int8" , " VK_KHR_8bit_storage" ,
1864
- " VK_KHR_16bit_storage" , " VK_KHR_shader_non_semantic_info"
1865
- }
1866
- );
1867
- }
1868
-
1869
- assert (ggml_vk_has_device (s_kompute_context));
1870
- ctx->device_ref ++;
1871
- }
1872
-
1873
- static void ggml_backend_kompute_device_unref (ggml_backend_buffer_type_t buft) {
1874
- auto * ctx = static_cast <ggml_backend_kompute_buffer_type_context *>(buft->context );
1875
-
1876
- assert (ctx->device_ref > 0 );
1877
-
1878
- ctx->device_ref --;
1879
-
1880
- if (!ctx->device_ref ) {
1881
- s_kompute_context->manager .destroy ();
1882
- }
1883
- }
1884
-
1885
1850
static const char * ggml_backend_kompute_buffer_get_name (ggml_backend_buffer_t buffer) {
1886
1851
auto * ctx = static_cast <ggml_backend_kompute_buffer_type_context *>(buffer->buft ->context );
1887
1852
return ctx->name .c_str ();
0 commit comments