Skip to content

Commit 13dd93a

Browse files
lattnermodularbot
authored andcommitted
Revert "[MAX Examples] move from StringLiteral to StaticString
This reverts commit 628c40a8200c548a3563c00ecc4311c451587827, it broke some tests that are in presubmits. MODULAR_ORIG_COMMIT_REV_ID: e20bb7963a54f2543a9f8306ff0321a9ab02ff6b
1 parent b370950 commit 13dd93a

File tree

8 files changed

+10
-10
lines changed

8 files changed

+10
-10
lines changed

examples/custom_ops/kernels/add_custom.mojo

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ struct AddConstantCustom[value: Int]:
2323
@staticmethod
2424
fn execute[
2525
# e.g. "CUDA" or "CPU"
26-
target: StaticString,
26+
target: StringLiteral,
2727
](
2828
out: OutputTensor,
2929
x: InputTensor[type = out.type, rank = out.rank],
@@ -53,7 +53,7 @@ struct AddOneCustom:
5353
@staticmethod
5454
fn execute[
5555
# The kind of device this will be run on: "cpu" or "gpu"
56-
target: StaticString,
56+
target: StringLiteral,
5757
](
5858
out: OutputTensor,
5959
x: InputTensor[type = out.type, rank = out.rank],

examples/custom_ops/kernels/fused_attention.mojo

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ struct FusedAttention:
8383
D: Int, # Head dimension
8484
BN: Int, # Dimension of blocks to split Q into
8585
BD: Int, # Dimension of blocks to split K, V into
86-
target: StaticString, # "cpu" or "gpu"
86+
target: StringLiteral, # "cpu" or "gpu"
8787
](
8888
output: OutputTensor[type=dtype, rank=rank],
8989
key: InputTensor[type=dtype, rank=rank],
@@ -210,7 +210,7 @@ fn fused_attention_cpu[
210210

211211
@always_inline
212212
fn matmul[
213-
target: StaticString,
213+
target: StringLiteral,
214214
transpose_b: Bool = False,
215215
](
216216
lhs: LayoutTensor,

examples/custom_ops/kernels/histogram.mojo

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ fn _histogram_gpu(
9999
struct Histogram:
100100
@staticmethod
101101
fn execute[
102-
target: StaticString
102+
target: StringLiteral
103103
](
104104
out: OutputTensor[type = DType.int64, rank=1],
105105
input: InputTensor[type = DType.uint8, rank=1],

examples/custom_ops/kernels/mandelbrot.mojo

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ struct Mandelbrot:
2929
@staticmethod
3030
fn execute[
3131
# The kind of device this will be run on: "cpu" or "gpu"
32-
target: StaticString,
32+
target: StringLiteral,
3333
](
3434
out: OutputTensor,
3535
# starting here are the list of inputs

examples/custom_ops/kernels/matrix_multiplication.mojo

+1-1
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ struct MatrixMultiplication[algorithm: StringLiteral]:
778778
@staticmethod
779779
fn execute[
780780
# The kind of device this will be run on: "cpu" or "gpu"
781-
target: StaticString,
781+
target: StringLiteral,
782782
](
783783
out: OutputTensor[rank=2],
784784
a: InputTensor[type = out.type, rank = out.rank],

examples/custom_ops/kernels/top_k.mojo

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ struct TopK:
5252
rank: Int,
5353
//, # Forces the previous two params to be inferred from the args
5454
K: Int,
55-
target: StaticString,
55+
target: StringLiteral,
5656
](
5757
out_vals: OutputTensor[type=dtype, rank=rank],
5858
out_idxs: OutputTensor[type = DType.int32, rank=rank],

examples/custom_ops/kernels/vector_addition.mojo

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ struct VectorAddition:
7575
@staticmethod
7676
fn execute[
7777
# The kind of device this will be run on: "cpu" or "gpu"
78-
target: StaticString,
78+
target: StringLiteral,
7979
](
8080
out: OutputTensor[rank=1],
8181
lhs: InputTensor[type = out.type, rank = out.rank],

mojo/stdlib/src/builtin/_format_float.mojo

+1-1
Original file line numberDiff line numberDiff line change
@@ -1689,7 +1689,7 @@ alias float8_e5m2_to_str = StaticTuple[StaticString, 256](
16891689
"nan",
16901690
)
16911691

1692-
alias float8_e4m3fn_to_str = StaticTuple[StaticString, 256](
1692+
alias float8_e4m3fn_to_str = StaticTuple[StringLiteral, 256](
16931693
"0.0",
16941694
"0.001953125",
16951695
"0.00390625",

0 commit comments

Comments
 (0)