Skip to content

Commit

Permalink
Added execution mode by default to SPEC PTD
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunsuresh committed Nov 28, 2024
1 parent 3144c2f commit 8338ee3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions script/get-spec-ptd/customize.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from cmind import utils
import os
import shutil
import stat


def preprocess(i):
Expand All @@ -22,6 +23,16 @@ def postprocess(i):
if env.get('CM_MLPERF_PTD_PATH', '') == '':
env['CM_MLPERF_PTD_PATH'] = os.path.join(
env['CM_MLPERF_POWER_SOURCE'], 'PTD', 'binaries', binary_name)

file_path = env['CM_MLPERF_PTD_PATH']
current_permissions = os.stat(file_path).st_mode

# Check if the file already has execute permissions
if not (current_permissions & stat.S_IXUSR): # Check user execute permission
# Add execute permissions for the user
os.chmod(file_path, current_permissions | stat.S_IXUSR)


env['CM_SPEC_PTD_PATH'] = env['CM_MLPERF_PTD_PATH']

return {'return': 0}

0 comments on commit 8338ee3

Please sign in to comment.