From 69789467ebb76526bffc8ad0e552858256b6a326 Mon Sep 17 00:00:00 2001 From: Michael Graeb Date: Mon, 7 Oct 2024 10:04:33 -0700 Subject: [PATCH 1/3] Add comment about tuning for "neoverse-v1" (#1153) --- cmake/AwsSIMD.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/AwsSIMD.cmake b/cmake/AwsSIMD.cmake index 753e53397..c9bb3c155 100644 --- a/cmake/AwsSIMD.cmake +++ b/cmake/AwsSIMD.cmake @@ -19,6 +19,7 @@ else() set(AWS_CLMUL_FLAG "-mpclmul") set(AWS_SSE4_2_FLAG "-msse4.2") + # AWS Graviton3 processors use neoverse-v1 check_c_compiler_flag("-mtune=neoverse-v1" HAVE_MTUNE_NEOVERSE_V1) if (HAVE_MTUNE_NEOVERSE_V1) set(AWS_ARMv8_1_FLAG "-march=armv8-a+crc+crypto -mtune=neoverse-v1") @@ -58,7 +59,7 @@ if (USE_CPU_EXTENSIONS) _mm256_permutevar8x32_epi32(vec, vec); return 0; - }" AWS_HAVE_AVX2_INTRINSICS) + }" AWS_HAVE_AVX2_INTRINSICS) check_c_source_compiles(" #include From f8c5d8e5134fa97955351a44f16b84f96de24045 Mon Sep 17 00:00:00 2001 From: Dengke Tang Date: Fri, 11 Oct 2024 15:08:29 -0700 Subject: [PATCH 2/3] [fix] prebuild set CMAKE_PREFIX_PATH properly (#1154) Co-authored-by: Michael Graeb --- cmake/AwsPrebuildDependency.cmake | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/cmake/AwsPrebuildDependency.cmake b/cmake/AwsPrebuildDependency.cmake index c0048f20a..598ea2aa4 100644 --- a/cmake/AwsPrebuildDependency.cmake +++ b/cmake/AwsPrebuildDependency.cmake @@ -25,11 +25,13 @@ function(aws_prebuild_dependency) set(depInstallDir ${depBinaryDir}/install) file(MAKE_DIRECTORY ${depBinaryDir}) + # Convert prefix path from list to escaped string, to be passed on command line + string(REPLACE ";" "\\\\;" ESCAPED_PREFIX_PATH "${CMAKE_PREFIX_PATH}") # For execute_process to accept a dynamically constructed command, it should be passed in a list format. - set(cmakeCommand "COMMAND" "${CMAKE_COMMAND}") + set(cmakeCommand "${CMAKE_COMMAND}") list(APPEND cmakeCommand -S ${AWS_PREBUILD_SOURCE_DIR}) list(APPEND cmakeCommand -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}) - list(APPEND cmakeCommand -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}) + list(APPEND cmakeCommand -DCMAKE_PREFIX_PATH=${ESCAPED_PREFIX_PATH}) list(APPEND cmakeCommand -DCMAKE_INSTALL_PREFIX=${depInstallDir}) list(APPEND cmakeCommand -DCMAKE_INSTALL_RPATH=${CMAKE_INSTALL_RPATH}) list(APPEND cmakeCommand -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}) @@ -39,11 +41,13 @@ function(aws_prebuild_dependency) list(APPEND cmakeCommand ${AWS_PREBUILD_CMAKE_ARGUMENTS}) endif() - list(APPEND cmakeCommand WORKING_DIRECTORY ${depBinaryDir}) - list(APPEND cmakeCommand RESULT_VARIABLE result) - # Configure dependency project. - execute_process(${cmakeCommand}) + execute_process( + COMMAND ${cmakeCommand} + WORKING_DIRECTORY ${depBinaryDir} + RESULT_VARIABLE result + ) + if (NOT ${result} EQUAL 0) message(FATAL_ERROR "Configuration failed for dependency project ${AWS_PREBUILD_DEPENDENCY_NAME}") endif() From 0e082566aa7ef1deb762c00cdf52e09e03e42317 Mon Sep 17 00:00:00 2001 From: Joseph Klix Date: Mon, 14 Oct 2024 16:33:50 -0700 Subject: [PATCH 3/3] improve condition_variable documentation (#1157) --- include/aws/common/condition_variable.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/include/aws/common/condition_variable.h b/include/aws/common/condition_variable.h index 82431dd4f..a4eb1bdfe 100644 --- a/include/aws/common/condition_variable.h +++ b/include/aws/common/condition_variable.h @@ -69,14 +69,17 @@ AWS_COMMON_API int aws_condition_variable_notify_all(struct aws_condition_variable *condition_variable); /** - * Waits the calling thread on a notification from another thread. + * Waits the calling thread on a notification from another thread. This function must be called with the mutex locked + * by the calling thread otherwise the behavior is undefined. Spurious wakeups can occur and to avoid this causing + * any problems use the _pred version of this function. */ AWS_COMMON_API int aws_condition_variable_wait(struct aws_condition_variable *condition_variable, struct aws_mutex *mutex); /** * Waits the calling thread on a notification from another thread. If predicate returns false, the wait is reentered, - * otherwise control returns to the caller. + * otherwise control returns to the caller. This function must be called with the mutex locked by the calling thread + * otherwise the behavior is undefined. */ AWS_COMMON_API int aws_condition_variable_wait_pred( @@ -87,7 +90,8 @@ int aws_condition_variable_wait_pred( /** * Waits the calling thread on a notification from another thread. Times out after time_to_wait. time_to_wait is in - * nanoseconds. + * nanoseconds. This function must be called with the mutex locked by the calling thread otherwise the behavior is + * undefined. Spurious wakeups can occur and to avoid this causing any problems use the _pred version of this function. */ AWS_COMMON_API int aws_condition_variable_wait_for( @@ -97,7 +101,8 @@ int aws_condition_variable_wait_for( /** * Waits the calling thread on a notification from another thread. Times out after time_to_wait. time_to_wait is in - * nanoseconds. If predicate returns false, the wait is reentered, otherwise control returns to the caller. + * nanoseconds. If predicate returns false, the wait is reentered, otherwise control returns to the caller. This + * function must be called with the mutex locked by the calling thread otherwise the behavior is undefined. */ AWS_COMMON_API int aws_condition_variable_wait_for_pred(