This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Skip extra blank line when parsing /proc/cpuinfo on LoongArch64
ClosedPublic

Authored by gonglingqin on Dec 11 2022, 6:29 PM.

Details

Summary

This fixes the following test cases:

  • affinity/kmp-affinity.c
  • affinity/kmp-hw-subset.c
  • affinity/omp-places.c

Diff Detail

Event Timeline

gonglingqin created this revision.Dec 11 2022, 6:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 11 2022, 6:29 PM
gonglingqin requested review of this revision.Dec 11 2022, 6:29 PM
Herald added a project: Restricted Project. · View Herald Transcript

About the title, how about make it more specfic. Like "[OpenMP] Skip extra blank line when parsing /proc/cpuinfo in kmp_affinity.cpp on LoongArch64".

About the title, how about make it more specfic. Like "[OpenMP] Skip extra blank line when parsing /proc/cpuinfo in kmp_affinity.cpp on LoongArch64".

Thanks, I will modify the title.

gonglingqin retitled this revision from [OpenMP] Add LoongArch64 support in kmp_affinity.cpp to [OpenMP] Skip extra blank line when parsing /proc/cpuinfo in kmp_affinity.cpp on LoongArch64.Dec 11 2022, 6:47 PM
xen0n retitled this revision from [OpenMP] Skip extra blank line when parsing /proc/cpuinfo in kmp_affinity.cpp on LoongArch64 to [OpenMP] Skip extra blank line when parsing /proc/cpuinfo on LoongArch64.Dec 12 2022, 12:10 AM
xen0n edited the summary of this revision. (Show Details)
xen0n added inline comments.Dec 12 2022, 12:15 AM
openmp/runtime/src/kmp_affinity.cpp
2948–2949

"But on LoongArch a blank line exists before ..." so the sentence could be shorter.

Also, as one of the people behind the kernel port, I can tell you we explicitly added the blank line because the "system type" line is unrelated to any of the CPUs; it's kind of global info. Maybe you can try mentioning this design consideration for more context but I feel it's okay to not do so either. It's up to you.

gonglingqin added inline comments.Dec 12 2022, 12:40 AM
openmp/runtime/src/kmp_affinity.cpp
2948–2949

Thanks! Glad to know the reason for this design, I will update the comments.

Address @xen0n's comments.

xen0n accepted this revision.Dec 12 2022, 1:13 AM

Thank you very much, this now looks good from the LoongArch side.

This revision is now accepted and ready to land.Dec 12 2022, 1:13 AM