lib/accy/src/kernel/library/random/key/names.zig

daab053ee43316e1809a84551d573ddd1e5bf3d2

 1 const random = @import("../root.zig");
 2 const types = @import("types.zig");
 3 
 4 const std = random.base.std;
 5 const PhiloxKeySplit = types.PhiloxKeySplit;
 6 const PhiloxKeyUniform = types.PhiloxKeyUniform;
 7 const PhiloxKeyCounterUniform = types.PhiloxKeyCounterUniform;
 8 
 9 pub fn philoxKeySplitFamilyTarget(allocator: std.mem.Allocator, instance: PhiloxKeySplit) ![]u8 {
10     return std.fmt.allocPrint(
11         allocator,
12         "accy.kernel.random.philox_key_split_family_{d}r_{d}_key",
13         .{ instance.rounds, instance.threads },
14     );
15 }
16 
17 pub fn philoxKeySplitFamilyEntryName(allocator: std.mem.Allocator, instance: PhiloxKeySplit) ![]u8 {
18     return std.fmt.allocPrint(
19         allocator,
20         "accy_kernel_random_philox_key_split_family_{d}r_{d}_key",
21         .{ instance.rounds, instance.threads },
22     );
23 }
24 
25 pub fn philoxKeyUniformFamilyTarget(allocator: std.mem.Allocator, instance: PhiloxKeyUniform) ![]u8 {
26     return std.fmt.allocPrint(
27         allocator,
28         "accy.kernel.random.philox_key_uniform_family_{d}r_{d}_{s}",
29         .{ instance.rounds, instance.threads, instance.dtype.name() },
30     );
31 }
32 
33 pub fn philoxKeyUniformFamilyEntryName(allocator: std.mem.Allocator, instance: PhiloxKeyUniform) ![]u8 {
34     return std.fmt.allocPrint(
35         allocator,
36         "accy_kernel_random_philox_key_uniform_family_{d}r_{d}_{s}",
37         .{ instance.rounds, instance.threads, instance.dtype.name() },
38     );
39 }
40 
41 pub fn philoxKeyCounterUniformFamilyTarget(allocator: std.mem.Allocator, instance: PhiloxKeyCounterUniform) ![]u8 {
42     return std.fmt.allocPrint(
43         allocator,
44         "accy.kernel.random.philox_key_counter_uniform_family_{d}r_{d}_{s}",
45         .{ instance.rounds, instance.threads, instance.dtype.name() },
46     );
47 }
48 
49 pub fn philoxKeyCounterUniformFamilyEntryName(allocator: std.mem.Allocator, instance: PhiloxKeyCounterUniform) ![]u8 {
50     return std.fmt.allocPrint(
51         allocator,
52         "accy_kernel_random_philox_key_counter_uniform_family_{d}r_{d}_{s}",
53         .{ instance.rounds, instance.threads, instance.dtype.name() },
54     );
55 }