Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,16 @@ cc_test(
],
)

cc_test(
name = "mandelbrot",
srcs = ["hwy/examples/mandelbrot.cc"],
copts = COPTS,
deps = [
":hwy",
":timer",
],
)

cc_test(
name = "masks_and_logic",
srcs = ["hwy/examples/masks_and_logic.cc"],
Expand Down
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,15 @@ target_link_libraries(dot_product_mixed_precision PRIVATE ${ATOMICS_LIBRARIES})
set_target_properties(dot_product_mixed_precision
PROPERTIES RUNTIME_OUTPUT_DIRECTORY "examples/")

# Mandelbrot
add_executable(mandelbrot hwy/examples/mandelbrot.cc)
target_compile_options(mandelbrot PRIVATE ${HWY_FLAGS})
target_compile_features(mandelbrot PRIVATE ${HWY_CXX_STD_TGT_COMPILE_FEATURE})
target_link_libraries(mandelbrot PRIVATE hwy)
target_link_libraries(mandelbrot PRIVATE ${ATOMICS_LIBRARIES})
set_target_properties(mandelbrot
PROPERTIES RUNTIME_OUTPUT_DIRECTORY "examples/")

# AES capture the flag example
add_executable(ctf_aes hwy/examples/ctf_aes.cc)
target_compile_options(ctf_aes PRIVATE ${HWY_FLAGS})
Expand Down
8 changes: 8 additions & 0 deletions hwy/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ Similar to array simple but uses type promotion to allow for
a greater range in resulting integer sum values before an
overflow occurs.

### `mandelbrot.cc`

Demonstrates:
- interleaved stores
- masks
- loop unrolling
- fused multiply add

### `matrix_transpose_scatter_gather.cc`

Matrix transposition via Gather and Scatter, showing:
Expand Down
Loading
Loading