Skip to content

Question about AVX support in BEAGLE #235

Description

@minghao-du

Hi,

I would like to know if BEAGLE currently supports AVX.

It appears to be supported in the CMakeLists file:

if (BEAGLE_OPTIMIZE_FOR_NATIVE_ARCH)
	include(CheckCXXCompilerFlag)
	CHECK_CXX_COMPILER_FLAG("-march=native" COMPILER_OPT_ARCH_NATIVE_SUPPORTED)
	if (COMPILER_OPT_ARCH_NATIVE_SUPPORTED)
		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
	else()
		CHECK_CXX_COMPILER_FLAG("/arch:AVX" COMPILER_OPT_ARCH_AVX_SUPPORTED)
		if(COMPILER_OPT_ARCH_AVX_SUPPORTED)
			set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:AVX")
		endif()
	endif()
endif()

My CPU supports AVX. However, when I set BEAGLE_OPTIMIZE_FOR_NATIVE_ARCH to true and compile the code, the generated libraries are libhmsbeagle-cpu.so and libhmsbeagle-cpu.40.so. I was expecting libhmsbeagle-cpu-avx.so and libhmsbeagle-cpu-avx.40.so to be created.

This is because libhmsbeagle-cpu.so and libhmsbeagle-cpu.40.so correspond to BeagleCPU4StateImpl.hpp, not BeagleCPU4StateAVXImpl.hpp. I've noticed that BeagleCPU4StateImpl.hpp does not seem to contain AVX optimizations like those found in BeagleCPU4StateAVXImpl.hpp.

Furthermore, it appears that some methods in BeagleCPU4StateAVXImpl.hpp, such as calcStatesStates, do not support partitions, which would imply they only function correctly with a single partition.

Therefore, my understanding is that BEAGLE does not currently provide full AVX support because the implementation is still under development. Is this correct?

Thank you.

Best,
Minghao

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions