Skip to content

Commit

Permalink
Way faster.
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamDue committed Jul 3, 2024
1 parent 709f746 commit 1aeca8b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions benchmarks/lexer/lisp/lexer.cu
Original file line number Diff line number Diff line change
Expand Up @@ -313,11 +313,11 @@ __global__ void to_config_kernel(State* d_to_state,
}
}

void to_config(State* d_to_state,
Char* d_in,
State* d_out,
Index* indices,
Size size) {
void to_config(TokenType* d_tokens,
Char* d_in,
State* d_out,
Index* indices,
Size size) {
Size block_size = 256;
Size grid_size = (size + block_size - 1) / block_size;
to_config_kernel<<<grid_size, block_size>>>(d_to_state,
Expand Down
8 changes: 4 additions & 4 deletions src/Alpacc/Generator/Futhark/Lexer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ transitionsToEndomorphismsArray parallel_lexer = do
where
to_endo = endomorphisms parallel_lexer

compositionsArray :: ParallelLexer Word8 Int -> Either String String
compositionsArray parallel_lexer = do
compositionsArray :: UInt -> ParallelLexer Word8 Int -> Either String String
compositionsArray int parallel_lexer = do
vals <-
maybeToEither errorMessage
$ mapM row [0..endomorphisms_size - 1]
Expand All @@ -60,7 +60,7 @@ compositionsArray parallel_lexer = do
endomorphisms_size = endomorphismsSize parallel_lexer
row j = do
vals <-
mapM (\k -> show <$> Map.lookup (k, j) _compositions)
mapM (\k -> (++ futPrint int) . show <$> Map.lookup (k, j) _compositions)
[0..endomorphisms_size - 1]
let result = List.intercalate ", " vals
return result
Expand Down Expand Up @@ -97,7 +97,7 @@ generateLexer lexer terminal_index_map terminal_type = do
let _identity = identity parallel_lexer
endomorphism_type <- endomorphismIntegral int_parallel_lexer
transitions_to_endo <- transitionsToEndomorphismsArray parallel_lexer
compositions_table <- compositionsArray parallel_lexer
compositions_table <- compositionsArray endomorphism_type parallel_lexer
Right $
futharkLexer
<> [i|
Expand Down

0 comments on commit 1aeca8b

Please sign in to comment.